generated

package
v0.0.0-...-358476e Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2022 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 {
	Mutation struct {
		CreateTodo func(childComplexity int, input model.NewTodo) int
		DeleteTodo func(childComplexity int, id string) int
		UpdateTodo func(childComplexity int, id string, updatedTodo model.NewTodo) int
	}

	Query struct {
		Todo  func(childComplexity int, id string) int
		Todos func(childComplexity int) int
	}

	Todo struct {
		Done func(childComplexity int) int
		ID   func(childComplexity int) int
		Text func(childComplexity int) int
	}

	User struct {
		ID   func(childComplexity int) int
		Name func(childComplexity int) int
	}
}

type Config

type Config struct {
	Resolvers  ResolverRoot
	Directives DirectiveRoot
	Complexity ComplexityRoot
}

type DirectiveRoot

type DirectiveRoot struct {
	HasRole func(ctx context.Context, obj interface{}, next graphql.Resolver, role model.Role) (res interface{}, err error)
}

type MutationResolver

type MutationResolver interface {
	CreateTodo(ctx context.Context, input model.NewTodo) (*model.Todo, error)
	UpdateTodo(ctx context.Context, id string, updatedTodo model.NewTodo) (*model.Todo, error)
	DeleteTodo(ctx context.Context, id string) (string, error)
}

type QueryResolver

type QueryResolver interface {
	Todos(ctx context.Context) ([]*model.Todo, error)
	Todo(ctx context.Context, id string) (*model.Todo, 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