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 { Mutation struct { CreateProduct func(childComplexity int, input model.ProductInput) int PlaceOrder func(childComplexity int, input model.OrderInput) int RegisterUser func(childComplexity int, input model.RegisterInput) int } Order struct { CreatedAt func(childComplexity int) int ID func(childComplexity int) int ProductID func(childComplexity int) int Quantity func(childComplexity int) int Status func(childComplexity int) int TotalPrice func(childComplexity int) int UpdatedAt func(childComplexity int) int UserID func(childComplexity int) int } Product struct { CreatedAt func(childComplexity int) int Description func(childComplexity int) int ID func(childComplexity int) int Name func(childComplexity int) int Price func(childComplexity int) int Stock func(childComplexity int) int UpdatedAt func(childComplexity int) int } Query struct { Order func(childComplexity int, id string) int Orders func(childComplexity int) int Product func(childComplexity int, id string) int Products func(childComplexity int) int User func(childComplexity int, id string) int Users func(childComplexity int) int } User struct { CreatedAt func(childComplexity int) int Email func(childComplexity int) int ID func(childComplexity int) int UpdatedAt func(childComplexity int) int Username 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 OrderService ¶
type ProductService ¶
type QueryResolver ¶
type QueryResolver interface { Users(ctx context.Context) ([]*model.User, error) User(ctx context.Context, id string) (*model.User, error) Products(ctx context.Context) ([]*model.Product, error) Product(ctx context.Context, id string) (*model.Product, error) Orders(ctx context.Context) ([]*model.Order, error) Order(ctx context.Context, id string) (*model.Order, error) }
type Resolver ¶
type Resolver struct { ProductService ProductService OrderService OrderService }
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.