execute

package
v0.0.0-...-2952f12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 10, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute(ctx context.Context, args *ExecutionArgs) *graphql.Response

Implements the "Executing requests" section of the GraphQL specification.

Returns either a synchronous ExecutionResult (if all encountered resolvers are synchronous), or a Promise of an ExecutionResult that will eventually be resolved and never rejected.

If the arguments to this function do not result in a legal execution context, a GraphQLError will be thrown immediately explaining the invalid input.

Types

type ExecutionArgs

type ExecutionArgs struct {
	Schema         *ast.Schema
	RawQuery       string
	Document       *ast.QueryDocument
	RootValue      interface{}            // optional
	VariableValues map[string]interface{} // optional
	OperationName  string                 // optional
	FieldResolver  FieldResolver          // optional
	TypeResolver   TypeResolver           // optional
}

type ExecutionContext

type ExecutionContext struct {
	Schema        *ast.Schema
	RootValue     interface{}
	FieldResolver FieldResolver
	TypeResolver  TypeResolver
}

TODO gqlgenのほうの executionContext と互換性取るか考える

type FieldResolver

type FieldResolver func(ctx context.Context, source interface{}, args map[string]interface{}) (interface{}, *gqlerror.Error)

type TypeResolver

type TypeResolver func(ctx context.Context, value interface{}, schema *ast.Schema, abstractType *ast.Type) string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL