Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Schema ¶
Schema represents a GraphQL schema with an optional resolver.
func MustParseSchema ¶
MustParseSchema calls ParseSchema and panics on error.
func ParseSchema ¶
ParseSchema parses a GraphQL schema and attaches the given root resolver. It returns an error if the Go type signature of the resolvers does not match the schema. If nil is passed as the resolver, then the schema can not be executed, but it may be inspected (e.g. with ToJSON).
func (*Schema) Exec ¶
func (s *Schema) Exec(ctx context.Context, queryString string, operationName string, variables map[string]interface{}) *graphql.Response
Exec executes the given query with the schema's resolver. It panics if the schema was created without a resolver. If the context get cancelled, no further resolvers will be called and a the context error will be returned as soon as possible (not immediately).
type SchemaOpt ¶
type SchemaOpt func(*Schema)
SchemaOpt is an option to pass to ParseSchema or MustParseSchema.
func Logger ¶
Logger is used to log panics during query execution. It defaults to exec.DefaultLogger.
func MaxDepth ¶
MaxDepth specifies the maximum field nesting depth in a query. The default is 0 which disables max depth checking.
func MaxParallelism ¶
MaxParallelism specifies the maximum number of resolvers per request allowed to run in parallel. The default is 10.