graph

package
v0.0.0-...-1e8fc56 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TodoA = &Todo{
		ID:   "0be25fcf-20e6-4a6d-b0f9-7804224ef20e",
		Text: "Todo A",
		Done: false,
	}

	TodoB = &Todo{
		ID:   "53314dfd-35a8-4665-b528-20d06ba549be",
		Text: "Todo B",
		Done: false,
	}

	TodoC = &Todo{
		ID:   "bb5893c7-eb8d-496b-ae36-6002bbe50b7e",
		Text: "Todo C",
		Done: false,
	}
)

Functions

func NewExecutableSchema

func NewExecutableSchema(cfg Config) graphql.ExecutableSchema

NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface.

Types

type ComplexityRoot

type ComplexityRoot struct {
	Query struct {
		Todos func(childComplexity int) int
	}

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

type Config

type Config struct {
	Resolvers  ResolverRoot
	Directives DirectiveRoot
	Complexity ComplexityRoot
}

type DirectiveRoot

type DirectiveRoot struct {
}

type QueryResolver

type QueryResolver interface {
	Todos(ctx context.Context) ([]*Todo, error)
}

type Resolver

type Resolver struct{}

func (*Resolver) Query

func (r *Resolver) Query() QueryResolver

type ResolverRoot

type ResolverRoot interface {
	Query() QueryResolver
}

type Todo

type Todo struct {
	ID   string `json:"id"`
	Text string `json:"text"`
	Done bool   `json:"done"`
}

Jump to

Keyboard shortcuts

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