Documentation
¶
Index ¶
- Constants
- func ParseArgumentList(l *Lexer) ast.ArgumentList
- func ParseDirectives(l *Lexer) ast.DirectiveList
- func ParseInputValue(l *Lexer) *ast.InputValueDefinition
- func ParseLiteral(l *Lexer, constOnly bool) ast.Value
- func ParseType(l *Lexer) ast.Type
- func ResolveType(t ast.Type, resolver Resolver) (ast.Type, *errors.QueryError)
- type Ident
- type Lexer
- func (l *Lexer) Ascend()
- 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() ast.Ident
- func (l *Lexer) ConsumeKeyword(keyword string)
- func (l *Lexer) ConsumeLiteral() *ast.PrimitiveValue
- func (l *Lexer) ConsumeToken(expected rune)
- func (l *Lexer) ConsumeWhitespace()
- func (l *Lexer) DescComment() string
- func (l *Lexer) DescString() string
- func (l *Lexer) Descend()
- func (l *Lexer) Location() errors.Location
- func (l *Lexer) Peek() rune
- func (l *Lexer) SyntaxError(message string)
- type Resolver
Constants ¶
const MaxParserDepth = 1000
MaxParserDepth is the maximum depth of nested selection sets, inline fragments, list literals, object literals, and list types that the parser will accept. This limit is in place to prevent stack overflows.
Variables ¶
This section is empty.
Functions ¶
func ParseArgumentList ¶ added in v1.1.0
func ParseArgumentList(l *Lexer) ast.ArgumentList
func ParseDirectives ¶
func ParseDirectives(l *Lexer) ast.DirectiveList
func ParseInputValue ¶
func ParseInputValue(l *Lexer) *ast.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) 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() *ast.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.