generated

package
v0.0.0-...-d57fdd4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 4, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

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 CartItemResolver interface {
	Product(ctx context.Context, obj *model.CartItem) (*model.Product, error)
}

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 DirectiveRoot struct {
	IsAuthenticated func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error)
}

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 QueryResolver interface {
	GetProduct(ctx context.Context, sku string) (*model.Product, error)
	GetUsers(ctx context.Context, pagination model.Pagination) ([]*model.User, error)
	GetUserCart(ctx context.Context) ([]*model.CartItem, error)
	GetUser(ctx context.Context) (*model.User, error)
}

type ResolverRoot

type ResolverRoot interface {
	CartItem() CartItemResolver
	Mutation() MutationResolver
	Query() QueryResolver
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL