var ( ErrUnknownType = errors.New("unknown type") ErrTypeNotFound = errors.New("type not found") )
func NewExecutableSchema(cfg Config) graphql.ExecutableSchema
NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface.
type ComplexityRoot struct { Entity struct { FindHelloByID func(childComplexity int, id string) int FindWorldByID func(childComplexity int, id string) int } Query struct { // contains filtered or unexported fields } World struct { ID func(childComplexity int) int Title func(childComplexity int) int } // contains filtered or unexported fields }
type Config struct { Schema *ast.Schema Resolvers ResolverRoot Directives DirectiveRoot Complexity ComplexityRoot }
type DirectiveRoot struct { }
type EntityResolver interface { FindHelloByID(ctx context.Context, id string) (Hello, error) FindWorldByID(ctx context.Context, id string) (*World, error) }
type Hello interface { IsEntity() IsHello() GetID() string GetTitle() string }
type Query struct { }
type ResolverRoot interface { Entity() EntityResolver }
type World struct { ID string `json:"id"` Title string `json:"title"` }
func (this World) GetID() string
func (this World) GetTitle() string
func (World) IsEntity()
func (World) IsHello()