Documentation ¶
Index ¶
- func ParseArgumentList(l *Lexer) types.ArgumentList
- func ParseDirectives(l *Lexer) types.DirectiveList
- func ParseInputValue(l *Lexer) *types.InputValueDefinition
- func ParseLiteral(l *Lexer, constOnly bool) types.Value
- func ParseType(l *Lexer) types.Type
- func ResolveType(t types.Type, resolver Resolver) (types.Type, *errors.QueryError)
- type Ident
- type Lexer
- func (l *Lexer) CatchScannerError(s *scanner.Scanner, msg string)
- func (l *Lexer) CatchSyntaxError(f func()) (errRes *errors.QueryError)
- func (l *Lexer) ConsumeIdent() string
- func (l *Lexer) ConsumeIdentWithLoc() types.Ident
- func (l *Lexer) ConsumeKeyword(keyword string)
- func (l *Lexer) ConsumeLiteral() *types.PrimitiveValue
- func (l *Lexer) ConsumeToken(expected rune)
- func (l *Lexer) ConsumeWhitespace()
- func (l *Lexer) DescComment() string
- func (l *Lexer) Location() errors.Location
- func (l *Lexer) Peek() rune
- func (l *Lexer) SyntaxError(message string)
- type Resolver
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseArgumentList ¶ added in v0.0.8
func ParseArgumentList(l *Lexer) types.ArgumentList
func ParseDirectives ¶
func ParseDirectives(l *Lexer) types.DirectiveList
func ParseInputValue ¶
func ParseInputValue(l *Lexer) *types.InputValueDefinition
func ResolveType ¶
ResolveType attempts to resolve a type's name against a resolving function. This function is used when one needs to check if a TypeName exists in the resolver (typically a Schema).
In the example below, ResolveType would be used to check if the resolving function returns a valid type for Dimension:
type Profile { picture(dimensions: Dimension): Url }
ResolveType recursively unwraps List and NonNull types until a NamedType is reached.
Types ¶
type Lexer ¶
type Lexer struct {
// contains filtered or unexported fields
}
func (*Lexer) CatchScannerError ¶ added in v0.0.7
func (*Lexer) CatchSyntaxError ¶
func (l *Lexer) CatchSyntaxError(f func()) (errRes *errors.QueryError)
func (*Lexer) ConsumeIdent ¶
func (*Lexer) ConsumeIdentWithLoc ¶
func (*Lexer) ConsumeKeyword ¶
func (*Lexer) ConsumeLiteral ¶
func (l *Lexer) ConsumeLiteral() *types.PrimitiveValue
func (*Lexer) ConsumeToken ¶
func (*Lexer) ConsumeWhitespace ¶
func (l *Lexer) ConsumeWhitespace()
ConsumeWhitespace consumes whitespace and tokens equivalent to whitespace (e.g. commas and comments).
Consumed comment characters will build the description for the next type or field encountered. The description is available from `DescComment()`, and will be reset every time `ConsumeWhitespace()` is executed unless l.useStringDescriptions is set.