graph

package
v0.0.0-...-a263ec7 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2024 License: MIT Imports: 15 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 {
	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 MutationResolver interface {
	CreateProduct(ctx context.Context, input model.NewProduct) (*model.Product, error)
	CreateCategory(ctx context.Context, input model.NewCategory) (*model.Category, error)
	CreateOrder(ctx context.Context, input model.NewOrder) (*model.Order, error)
}

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
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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