MCPcopy Create free account
hub / github.com/openai/plugins / parseFragment

Method parseFragment

plugins/shopify/skills/shopify-partner/scripts/validate.mjs:2178–2195  ·  view source on GitHub ↗

* Corresponds to both FragmentSpread and InlineFragment in the spec. * * FragmentSpread : ... FragmentName Directives? * * InlineFragment : ... TypeCondition? Directives? SelectionSet

()

Source from the content-addressed store, hash-verified

2176 * InlineFragment : ... TypeCondition? Directives? SelectionSet
2177 */
2178 parseFragment() {
2179 const start = this._lexer.token;
2180 this.expectToken(_tokenKind.TokenKind.SPREAD);
2181 const hasTypeCondition = this.expectOptionalKeyword("on");
2182 if (!hasTypeCondition && this.peek(_tokenKind.TokenKind.NAME)) {
2183 return this.node(start, {
2184 kind: _kinds.Kind.FRAGMENT_SPREAD,
2185 name: this.parseFragmentName(),
2186 directives: this.parseDirectives(false)
2187 });
2188 }
2189 return this.node(start, {
2190 kind: _kinds.Kind.INLINE_FRAGMENT,
2191 typeCondition: hasTypeCondition ? this.parseNamedType() : void 0,
2192 directives: this.parseDirectives(false),
2193 selectionSet: this.parseSelectionSet()
2194 });
2195 }
2196 /**
2197 * FragmentDefinition :
2198 * - fragment FragmentName on TypeCondition Directives? SelectionSet

Callers 1

parseSelectionMethod · 0.45

Calls 8

expectTokenMethod · 0.45
expectOptionalKeywordMethod · 0.45
peekMethod · 0.45
nodeMethod · 0.45
parseFragmentNameMethod · 0.45
parseDirectivesMethod · 0.45
parseNamedTypeMethod · 0.45
parseSelectionSetMethod · 0.45

Tested by

no test coverage detected