graphql

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2023 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 {
		AddTodoItem    func(childComplexity int, input todo.NewItem) int
		UpdateTodoItem func(childComplexity int, input TodoItemUpdate) int
	}

	Query struct {
		TodoItems func(childComplexity int) int
	}

	TodoItem struct {
		Completed func(childComplexity int) int
		ID        func(childComplexity int) int
		Order     func(childComplexity int) int
		Title     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 {
	AddTodoItem(ctx context.Context, input todo.NewItem) (*todo.Item, error)
	UpdateTodoItem(ctx context.Context, input TodoItemUpdate) (*todo.Item, error)
}

type QueryResolver

type QueryResolver interface {
	TodoItems(ctx context.Context) ([]todo.Item, error)
}

type ResolverRoot

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

type TodoItemUpdate

type TodoItemUpdate struct {
	ID        string  `json:"id"`
	Title     *string `json:"title,omitempty"`
	Completed *bool   `json:"completed,omitempty"`
	Order     *int    `json:"order,omitempty"`
}

Jump to

Keyboard shortcuts

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