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 { Category struct { ID func(childComplexity int) int Name func(childComplexity int) int } Mutation struct { CreateCategory func(childComplexity int, input model.NewCategory) int CreateOrder func(childComplexity int, input model.NewOrder) int CreateProduct func(childComplexity int, input model.NewProduct) int } Order struct { PaymentURL func(childComplexity int) int } Product struct { Active func(childComplexity int) int Category func(childComplexity int) int CategoryID func(childComplexity int) int Code func(childComplexity int) int Description func(childComplexity int) int ID func(childComplexity int) int ImageURL func(childComplexity int) int Name func(childComplexity int) int Price func(childComplexity int) int } Query struct { Categories func(childComplexity int) int GetCategory func(childComplexity int, input *model.RetrieveByID) int GetProduct func(childComplexity int, input *model.RetrieveByID) int Products 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 QueryResolver ¶
type QueryResolver interface { Products(ctx context.Context) ([]*model.Product, error) Categories(ctx context.Context) ([]*model.Category, error) GetProduct(ctx context.Context, input *model.RetrieveByID) (*model.Product, error) GetCategory(ctx context.Context, input *model.RetrieveByID) (*model.Category, error) }
type Resolver ¶
type Resolver struct {
Repositories *shared.ContainerRepository
}
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.