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

Method parseInputValueDef

parser/schema.go:283–303  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

281}
282
283func (p *parser) parseInputValueDef() *FieldDefinition {
284 var def FieldDefinition
285
286 desc := p.parseDescription()
287 if desc.text != "" {
288 def.BeforeDescriptionComment = desc.comment
289 def.Description = desc.text
290 }
291
292 p.peek() // peek to set p.comment
293 def.AfterDescriptionComment = p.comment
294 def.Position = p.peekPos()
295 def.Name = p.parseName()
296 p.expect(lexer.Colon)
297 def.Type = p.parseTypeReference()
298 if p.skip(lexer.Equals) {
299 def.DefaultValue = p.parseValueLiteral(true)
300 }
301 def.Directives = p.parseDirectives(true)
302 return &def
303}
304
305func (p *parser) parseInterfaceTypeDefinition(description descriptionWithComment) *Definition {
306 _, comment := p.expectKeyword("interface")

Callers 1

Calls 9

parseDescriptionMethod · 0.95
peekMethod · 0.95
peekPosMethod · 0.95
parseNameMethod · 0.95
expectMethod · 0.95
parseTypeReferenceMethod · 0.95
skipMethod · 0.95
parseValueLiteralMethod · 0.95
parseDirectivesMethod · 0.95

Tested by

no test coverage detected