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 CartItemResolver ¶
type ComplexityRoot ¶
type ComplexityRoot struct { CartItem struct { ID func(childComplexity int) int Product func(childComplexity int) int ProductSku func(childComplexity int) int Quantity func(childComplexity int) int } LoginResponse struct { JwtToken func(childComplexity int) int User func(childComplexity int) int } Mutation struct { AddNewProduct func(childComplexity int, input model.NewProduct) int AddToCart func(childComplexity int, input model.NewCartItem) int AuthLogin func(childComplexity int, email string, password string) int CreateUser func(childComplexity int, input model.NewUser) int RemoveItemsFromUserCart func(childComplexity int, itemsID []string) int } Product struct { Brand func(childComplexity int) int Category func(childComplexity int) int Description func(childComplexity int) int ImageURL func(childComplexity int) int Name func(childComplexity int) int Price func(childComplexity int) int Sku func(childComplexity int) int } Query struct { GetProduct func(childComplexity int, sku string) int GetUser func(childComplexity int) int GetUserCart func(childComplexity int) int GetUsers func(childComplexity int, pagination model.Pagination) int } User struct { Country func(childComplexity int) int Email func(childComplexity int) int FullName func(childComplexity int) int ID func(childComplexity int) int } }
type Config ¶
type Config struct { Resolvers ResolverRoot Directives DirectiveRoot Complexity ComplexityRoot }
type DirectiveRoot ¶
type MutationResolver ¶
type MutationResolver interface { AuthLogin(ctx context.Context, email string, password string) (*model.LoginResponse, error) CreateUser(ctx context.Context, input model.NewUser) (*model.User, error) AddNewProduct(ctx context.Context, input model.NewProduct) (*model.Product, error) AddToCart(ctx context.Context, input model.NewCartItem) (*model.CartItem, error) RemoveItemsFromUserCart(ctx context.Context, itemsID []string) ([]*model.CartItem, error) }
type QueryResolver ¶
type ResolverRoot ¶
type ResolverRoot interface { CartItem() CartItemResolver Mutation() MutationResolver Query() QueryResolver }
Click to show internal directories.
Click to hide internal directories.