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

Method parseUnionTypeDefinition

parser/schema.go:321–334  ·  view source on GitHub ↗
(description descriptionWithComment)

Source from the content-addressed store, hash-verified

319}
320
321func (p *parser) parseUnionTypeDefinition(description descriptionWithComment) *Definition {
322 _, comment := p.expectKeyword("union")
323
324 var def Definition
325 def.Position = p.peekPos()
326 def.Kind = Union
327 def.BeforeDescriptionComment = description.comment
328 def.Description = description.text
329 def.AfterDescriptionComment = comment
330 def.Name = p.parseName()
331 def.Directives = p.parseDirectives(true)
332 def.Types, def.TypePositions = p.parseUnionMemberTypes()
333 return &def
334}
335
336// parseUnionMemberTypes parses a union's member type list. It returns the member
337// type names alongside their source positions; the two slices have equal length

Callers 1

Calls 5

expectKeywordMethod · 0.95
peekPosMethod · 0.95
parseNameMethod · 0.95
parseDirectivesMethod · 0.95
parseUnionMemberTypesMethod · 0.95

Tested by

no test coverage detected