go_gqlgen

package module
v0.0.0-...-e96df23 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AllStatus = []Status{
	StatusDone,
	StatusPending,
}

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 NewTodo) int
		DeleteTodo   func(childComplexity int, id string) int
		MarkComplete func(childComplexity int, id string) int
	}

	Query struct {
		Todos func(childComplexity int, typeArg *Status) 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 MutationResolver

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

type NewTodo

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

type QueryResolver

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

type Resolver

type Resolver struct {
	DB *sqlx.DB
}

func (*Resolver) Mutation

func (r *Resolver) Mutation() MutationResolver

func (*Resolver) Query

func (r *Resolver) Query() QueryResolver

type ResolverRoot

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

type Status

type Status string
const (
	StatusDone    Status = "DONE"
	StatusPending Status = "PENDING"
)

func (Status) IsValid

func (e Status) IsValid() bool

func (Status) MarshalGQL

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

func (Status) String

func (e Status) String() string

func (*Status) UnmarshalGQL

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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