Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewExecutableSchema ¶
func NewExecutableSchema(cfg Config) graphql.ExecutableSchema
NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface.
Types ¶
type ComplexityRoot ¶
type ComplexityRoot struct { Item struct { Description func(childComplexity int) int ID func(childComplexity int) int Name func(childComplexity int) int Price func(childComplexity int) int } Mutation struct { CreateItem func(childComplexity int, name string, description *string, price float64) int CreateOrder func(childComplexity int, input model.OrderInput) int DeleteItem func(childComplexity int, id string) int DeleteOrder func(childComplexity int, id string) int UpdateItem func(childComplexity int, id string, name *string, description *string, price *float64) int UpdateOrder func(childComplexity int, id string, status string) int } Order struct { CreatedAt func(childComplexity int) int ID func(childComplexity int) int Items func(childComplexity int) int Status func(childComplexity int) int Total func(childComplexity int) int User func(childComplexity int) int } Query struct { Item func(childComplexity int, id string) int Items func(childComplexity int) int Me func(childComplexity int) int Order func(childComplexity int, id string) int Orders func(childComplexity int) int } User struct { Email func(childComplexity int) int ID func(childComplexity int) int Name func(childComplexity int) int } }
type Config ¶
type Config struct { Schema *ast.Schema Resolvers ResolverRoot Directives DirectiveRoot Complexity ComplexityRoot }
type DirectiveRoot ¶
type DirectiveRoot struct { }
type MutationResolver ¶
type MutationResolver interface { CreateItem(ctx context.Context, name string, description *string, price float64) (*model.Item, error) UpdateItem(ctx context.Context, id string, name *string, description *string, price *float64) (*model.Item, error) DeleteItem(ctx context.Context, id string) (*model.Item, error) CreateOrder(ctx context.Context, input model.OrderInput) (*model.Order, error) UpdateOrder(ctx context.Context, id string, status string) (*model.Order, error) DeleteOrder(ctx context.Context, id string) (*model.Order, error) }
type QueryResolver ¶
type Resolver ¶
type Resolver struct{}
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.