MCPcopy Create free account
hub / github.com/vektah/gqlparser / parseSchemaExtension

Method parseSchemaExtension

parser/schema.go:440–454  ·  view source on GitHub ↗
(comment *CommentGroup)

Source from the content-addressed store, hash-verified

438}
439
440func (p *parser) parseSchemaExtension(comment *CommentGroup) *SchemaDefinition {
441 p.expectKeyword("schema")
442
443 var def SchemaDefinition
444 def.Position = p.peekPos()
445 def.AfterDescriptionComment = comment
446 def.Directives = p.parseDirectives(true)
447 def.EndOfDefinitionComment = p.some(lexer.BraceL, lexer.BraceR, func() {
448 def.OperationTypes = append(def.OperationTypes, p.parseOperationTypeDefinition())
449 })
450 if len(def.Directives) == 0 && len(def.OperationTypes) == 0 {
451 p.unexpectedError()
452 }
453 return &def
454}
455
456func (p *parser) parseScalarTypeExtension(comment *CommentGroup) *Definition {
457 p.expectKeyword("scalar")

Callers 1

Calls 6

expectKeywordMethod · 0.95
peekPosMethod · 0.95
parseDirectivesMethod · 0.95
someMethod · 0.95
unexpectedErrorMethod · 0.95

Tested by

no test coverage detected