generated

package
v0.0.0-...-e970dd6 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2022 License: Apache-2.0 Imports: 11 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
		CreateUser func(childComplexity int, input model.NewUser) int
		DeleteTodo func(childComplexity int, id string) int
		DeleteUser func(childComplexity int, id string) int
		UpdateTodo func(childComplexity int, id string, text string, done bool) int
	}

	Query struct {
		AllTodos      func(childComplexity int, last *int) int
		AllUsers      func(childComplexity int, last *int) int
		Todo          func(childComplexity int, id int) int
		TodosByStatus func(childComplexity int, status *bool) int
		User          func(childComplexity int, id int) int
	}

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

	User struct {
		Gender func(childComplexity int) int
		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 {
}

type MutationResolver

type MutationResolver interface {
	CreateTodo(ctx context.Context, input model.NewTodo) (*model.Todo, error)
	UpdateTodo(ctx context.Context, id string, text string, done bool) (*model.Todo, error)
	DeleteTodo(ctx context.Context, id string) (*model.Todo, error)
	CreateUser(ctx context.Context, input model.NewUser) (*model.User, error)
	DeleteUser(ctx context.Context, id string) (*model.User, error)
}

type QueryResolver

type QueryResolver interface {
	AllTodos(ctx context.Context, last *int) ([]*model.Todo, error)
	Todo(ctx context.Context, id int) (*model.Todo, error)
	TodosByStatus(ctx context.Context, status *bool) ([]*model.Todo, error)
	AllUsers(ctx context.Context, last *int) ([]*model.User, error)
	User(ctx context.Context, id int) (*model.User, error)
}

type ResolverRoot

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

type TodoResolver

type TodoResolver interface {
	Owner(ctx context.Context, obj *model.Todo) (*model.User, error)
}

Jump to

Keyboard shortcuts

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