graph

package
v0.0.0-...-288c1ed Latest Latest
Warning

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

Go to latest
Published: Feb 23, 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 {
	Item struct {
		Description func(childComplexity int) int
		ID          func(childComplexity int) int
		Name        func(childComplexity int) int
		Price       func(childComplexity int) int
	}

	Mutation struct {
		CreateItem  func(childComplexity int, name string, description *string, price float64) int
		CreateOrder func(childComplexity int, input model.OrderInput) int
		DeleteItem  func(childComplexity int, id string) int
		DeleteOrder func(childComplexity int, id string) int
		UpdateItem  func(childComplexity int, id string, name *string, description *string, price *float64) int
		UpdateOrder func(childComplexity int, id string, status string) int
	}

	Order struct {
		CreatedAt func(childComplexity int) int
		ID        func(childComplexity int) int
		Items     func(childComplexity int) int
		Status    func(childComplexity int) int
		Total     func(childComplexity int) int
		User      func(childComplexity int) int
	}

	Query struct {
		Item   func(childComplexity int, id string) int
		Items  func(childComplexity int) int
		Me     func(childComplexity int) int
		Order  func(childComplexity int, id string) int
		Orders func(childComplexity int) int
	}

	User struct {
		Email func(childComplexity int) int
		ID    func(childComplexity int) int
		Name  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 {
	CreateItem(ctx context.Context, name string, description *string, price float64) (*model.Item, error)
	UpdateItem(ctx context.Context, id string, name *string, description *string, price *float64) (*model.Item, error)
	DeleteItem(ctx context.Context, id string) (*model.Item, error)
	CreateOrder(ctx context.Context, input model.OrderInput) (*model.Order, error)
	UpdateOrder(ctx context.Context, id string, status string) (*model.Order, error)
	DeleteOrder(ctx context.Context, id string) (*model.Order, error)
}

type QueryResolver

type QueryResolver interface {
	Items(ctx context.Context) ([]*model.Item, error)
	Item(ctx context.Context, id string) (*model.Item, error)
	Orders(ctx context.Context) ([]*model.Order, error)
	Order(ctx context.Context, id string) (*model.Order, error)
	Me(ctx context.Context) (*model.User, error)
}

type Resolver

type Resolver struct{}

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