gql

package
v0.0.0-...-bbf7e2a Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: MIT 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 ComplexityRoot

type ComplexityRoot struct {
	AllOrdersOrder struct {
		ID         func(childComplexity int) int
		PriceTotal func(childComplexity int) int
		Quantity   func(childComplexity int) int
		UserID     func(childComplexity int) int
	}

	Mutation struct {
		CreateProduct   func(childComplexity int, input gqlmodel.CreateProduct) int
		Login           func(childComplexity int, input gqlmodel.Login) int
		PlaceOrder      func(childComplexity int, input gqlmodel.PlaceOrder) int
		RegisterUser    func(childComplexity int, input gqlmodel.NewUser) int
		UpdateInventory func(childComplexity int, input gqlmodel.UpdateInventory) int
	}

	Order struct {
		ID            func(childComplexity int) int
		OrderProducts func(childComplexity int) int
		PriceTotal    func(childComplexity int) int
		Quantity      func(childComplexity int) int
		UserID        func(childComplexity int) int
	}

	OrderProduct struct {
		Price     func(childComplexity int) int
		ProductID func(childComplexity int) int
		Quantity  func(childComplexity int) int
	}

	Product struct {
		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
	}

	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
	}

	Token struct {
		Token func(childComplexity int) int
	}

	UpdateInventoryResponse struct {
		Success func(childComplexity int) int
	}

	User struct {
		Email    func(childComplexity int) int
		ID       func(childComplexity int) int
		Type     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 MutationResolver interface {
	RegisterUser(ctx context.Context, input gqlmodel.NewUser) (*gqlmodel.User, error)
	Login(ctx context.Context, input gqlmodel.Login) (*gqlmodel.Token, error)
	CreateProduct(ctx context.Context, input gqlmodel.CreateProduct) (*gqlmodel.Product, error)
	UpdateInventory(ctx context.Context, input gqlmodel.UpdateInventory) (*gqlmodel.UpdateInventoryResponse, error)
	PlaceOrder(ctx context.Context, input gqlmodel.PlaceOrder) (*gqlmodel.Order, error)
}

type QueryResolver

type QueryResolver interface {
	User(ctx context.Context, id string) (*gqlmodel.User, error)
	Users(ctx context.Context) ([]*gqlmodel.User, error)
	Product(ctx context.Context, id string) (*gqlmodel.Product, error)
	Products(ctx context.Context) ([]*gqlmodel.Product, error)
	Order(ctx context.Context, id string) (*gqlmodel.Order, error)
	Orders(ctx context.Context) ([]*gqlmodel.AllOrdersOrder, error)
}

type ResolverRoot

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

Jump to

Keyboard shortcuts

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