Back to godoc.org
github.com/99designs/gqlgen / example / type-system-extension

Package type_system_extension

v0.13.0
Latest Go to latest

The latest major version is .

Published: 2 days ago | License: MIT | Module: github.com/99designs/gqlgen

Index

Variables

var AllState = []State{
	StateNotYet,
	StateDone,
}

func EnumLogging

func EnumLogging(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error)

func FieldLogging

func FieldLogging(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error)

func InputLogging

func InputLogging(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error)

func NewExecutableSchema

func NewExecutableSchema(cfg Config) graphql.ExecutableSchema

NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface.

func ObjectLogging

func ObjectLogging(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error)

func ScalarLogging

func ScalarLogging(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error)

func UnionLogging

func UnionLogging(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error)

type ComplexityRoot

type ComplexityRoot struct {
	MyMutation struct {
		CreateTodo func(childComplexity int, todo TodoInput) int
	}

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

	Todo struct {
		ID       func(childComplexity int) int
		State    func(childComplexity int) int
		Text     func(childComplexity int) int
		Verified func(childComplexity int) int
	}
}

type Config

type Config struct {
	Resolvers  ResolverRoot
	Directives DirectiveRoot
	Complexity ComplexityRoot
}

type Data

type Data interface {
	IsData()
}

type DirectiveRoot

type DirectiveRoot struct {
	EnumLogging      func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error)
	FieldLogging     func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error)
	InputLogging     func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error)
	InterfaceLogging func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error)
	ObjectLogging    func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error)
	ScalarLogging    func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error)
	UnionLogging     func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error)
}

type MyMutationResolver

type MyMutationResolver interface {
	CreateTodo(ctx context.Context, todo TodoInput) (*Todo, error)
}

type MyQueryResolver

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

type Node

type Node interface {
	IsNode()
}

type ResolverRoot

type ResolverRoot interface {
	MyMutation() MyMutationResolver
	MyQuery() MyQueryResolver
}

func NewRootResolver

func NewRootResolver() ResolverRoot

type State

type State string
const (
	StateNotYet State = "NOT_YET"
	StateDone   State = "DONE"
)

func (State) IsValid

func (e State) IsValid() bool

func (State) MarshalGQL

func (e State) MarshalGQL(w io.Writer)

func (State) String

func (e State) String() string

func (*State) UnmarshalGQL

func (e *State) UnmarshalGQL(v interface{}) error

type Todo

type Todo struct {
	ID       string `json:"id"`
	Text     string `json:"text"`
	State    State  `json:"state"`
	Verified bool   `json:"verified"`
}

func (Todo) IsData

func (Todo) IsData()

func (Todo) IsNode

func (Todo) IsNode()

type TodoInput

type TodoInput struct {
	Text string `json:"text"`
}

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier