Documentation ¶
Overview ¶
Code generated by tools/listgen DO NOT EDIT!
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // SkipDirective is the definition for the built-in "@skip" directive. SkipDirective = &ast.DirectiveDefinition{ Name: "skip", Description: "Directs the executor to skip this field or fragment when the `if` argument is true.", DirectiveLocations: ast.DirectiveLocationKindField | ast.DirectiveLocationKindFragmentSpread | ast.DirectiveLocationKindInlineFragment, ArgumentsDefinition: (*ast.InputValueDefinitions)(nil). Add(ast.InputValueDefinition{ Name: "if", Description: "Skipped when true.", Type: ast.Type{ NamedType: "Boolean", Kind: ast.TypeKindNamed, NonNullable: true, }, }), } // IncludeDirective is the definition for the built-in "@include" directive. IncludeDirective = &ast.DirectiveDefinition{ Name: "include", Description: "Directs the executor to include this field or fragment only when the `if` argument is true.", DirectiveLocations: ast.DirectiveLocationKindField | ast.DirectiveLocationKindFragmentSpread | ast.DirectiveLocationKindInlineFragment, ArgumentsDefinition: (*ast.InputValueDefinitions)(nil). Add(ast.InputValueDefinition{ Name: "if", Description: "Included when true.", Type: ast.Type{ NamedType: "Boolean", Kind: ast.TypeKindNamed, NonNullable: true, }, }), } // DeprecatedDirective is the definition for the built-in "@deprecated" directive. DeprecatedDirective = &ast.DirectiveDefinition{ Name: "deprecated", Description: "Marks an element of a GraphQL schema as no longer supported.", DirectiveLocations: ast.DirectiveLocationKindFieldDefinition | ast.DirectiveLocationKindEnumValue, ArgumentsDefinition: (*ast.InputValueDefinitions)(nil). Add(ast.InputValueDefinition{ Name: "reason", Description: "Explains why this element was deprecated, usually also including a " + "suggestion for how to access supported similar data. Formatted using " + "the Markdown syntax (as specified by [CommonMark](https://commonmark.org/).", Type: ast.Type{ NamedType: "String", Kind: ast.TypeKindNamed, }, DefaultValue: &ast.Value{ StringValue: "No longer supported", Kind: ast.ValueKindString, }, }), } // IDType ... // TODO: Fully implement. IDType = &ast.TypeDefinition{ Name: "ID", Kind: ast.TypeDefinitionKindScalar, } // StringType ... // TODO: Fully implement. StringType = &ast.TypeDefinition{ Name: "String", Kind: ast.TypeDefinitionKindScalar, } )
Functions ¶
func SpecifiedDirectives ¶
func SpecifiedDirectives() map[string]*ast.DirectiveDefinition
SpecifiedDirectives returns a map similar to the one found on the Schema type, containing all pre-defined GraphQL directives. It is returned from a function to avoid this map being mutated, as it is used in several places.
Types ¶
type Error ¶
Error fulfils the requirements of a GraphQL error type.
func (*Error) MarshalJSON ¶
MarshalJSON returns this Error as some JSON bytes. If the Error is invalid, an error will be returned.
type Errors ¶
type Errors struct { Data Error // contains filtered or unexported fields }
Errors is a linked list that contains Error values.
func ErrorsFromSlice ¶
ErrorsFromSlice returns a Errors list from a slice of Error.
func (*Errors) Generator ¶
func (es *Errors) Generator() ErrorsGenerator
Generator returns a "Generator" type for this list, allowing for much more efficient iteration over items within this linked list than using ForEach, though ForEach may still be more convenient, because ForEach is a high order function, it's slower.
func (*Errors) Insert ¶
Insert places the Error in the position given by pos. The method will insert at top if pos is greater than or equal to list length. The method will insert at bottom if the pos is less than 0.
type ErrorsGenerator ¶
type ErrorsGenerator struct {
// contains filtered or unexported fields
}
ErrorsGenerator is a type used to iterate efficiently over Errors. @wg:ignore
func (*ErrorsGenerator) Next ¶
func (g *ErrorsGenerator) Next() (Error, int)
Next returns the current value, and it's index in the list, and sets up the next value to be returned.
func (*ErrorsGenerator) Reset ¶
func (g *ErrorsGenerator) Reset()
Reset returns this generator to it's initial state, allowing it to be used again to iterate over this linked list.
type Schema ¶
type Schema struct { Definition *ast.SchemaDefinition // NOTE: The following should all have the "kind" ast.TypeKindNamed. QueryType *ast.Type MutationType *ast.Type SubscriptionType *ast.Type Directives map[string]*ast.DirectiveDefinition Types map[string]*ast.TypeDefinition }
Schema ...