Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrorPresenter = func(logger *slog.Logger) graphql.ErrorPresenterFunc { return func(ctx context.Context, err error) *gqlerror.Error { if err == nil { return &errInternalServer } logger.Info("api error", slog.String("original_error", err.Error())) apiErr := parseError(ctx, err) apiErr.Path = graphql.GetPath(ctx) return &apiErr } }
Functions ¶
func NewExecutableSchema ¶
func NewExecutableSchema(cfg Config) graphql.ExecutableSchema
NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface.
Types ¶
type ComplexityRoot ¶
type Config ¶
type Config struct { Schema *ast.Schema Resolvers ResolverRoot Directives DirectiveRoot Complexity ComplexityRoot }
type DirectiveRoot ¶
type DirectiveRoot struct { }
type MutationResolver ¶
type QueryResolver ¶
type Resolver ¶
type Resolver struct { FooService fooService // contains filtered or unexported fields }
Resolver is the root resolver for the GraphQL API it contains all the services that will be used by the resolvers.
func NewResolvers ¶
NewResolvers returns a new instance of the root resolver.
func (*Resolver) Mutation ¶
func (r *Resolver) Mutation() MutationResolver
Mutation returns MutationResolver implementation.
func (*Resolver) Query ¶
func (r *Resolver) Query() QueryResolver
Query returns QueryResolver implementation.
type ResolverRoot ¶
type ResolverRoot interface { Mutation() MutationResolver Query() QueryResolver }
Click to show internal directories.
Click to hide internal directories.