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

Method parseVariableDefinition

parser/query.go:100–117  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

98}
99
100func (p *parser) parseVariableDefinition() *VariableDefinition {
101 var def VariableDefinition
102 def.Position = p.peekPos()
103 def.Comment = p.comment
104 def.Variable = p.parseVariable()
105
106 p.expect(lexer.Colon)
107
108 def.Type = p.parseTypeReference()
109
110 if p.skip(lexer.Equals) {
111 def.DefaultValue = p.parseValueLiteral(true)
112 }
113
114 def.Directives = p.parseDirectives(false)
115
116 return &def
117}
118
119func (p *parser) parseVariable() string {
120 p.expect(lexer.Dollar)

Callers 1

Calls 7

peekPosMethod · 0.95
parseVariableMethod · 0.95
expectMethod · 0.95
parseTypeReferenceMethod · 0.95
skipMethod · 0.95
parseValueLiteralMethod · 0.95
parseDirectivesMethod · 0.95

Tested by

no test coverage detected