generated

package
v0.0.0-...-335ed28 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2021 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 {
		CreateThought func(childComplexity int, input model.NewThought) int
		DeleteThought func(childComplexity int, id int, userID int) int
		UpdateThought func(childComplexity int, id int, userID int, input model.NewThought) int
	}

	Query struct {
		Thought  func(childComplexity int, id int) int
		Thoughts func(childComplexity int) int
	}

	Thought struct {
		Body     func(childComplexity int) int
		ID       func(childComplexity int) int
		ImageURL func(childComplexity int) int
		Title    func(childComplexity int) int
		User     func(childComplexity int) int
	}

	User struct {
		Email 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 {
	CreateThought(ctx context.Context, input model.NewThought) (*model.Thought, error)
	UpdateThought(ctx context.Context, id int, userID int, input model.NewThought) (*model.Thought, error)
	DeleteThought(ctx context.Context, id int, userID int) (*model.Thought, error)
}

type QueryResolver

type QueryResolver interface {
	Thoughts(ctx context.Context) ([]*model.Thought, error)
	Thought(ctx context.Context, id int) (*model.Thought, error)
}

type ResolverRoot

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

type ThoughtResolver

type ThoughtResolver interface {
	User(ctx context.Context, obj *model.Thought) (*model.User, error)
}

Jump to

Keyboard shortcuts

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