execschema

package
v0.0.0-...-97db5e8 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 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 {
		RegisterUser func(childComplexity int, name string) int
	}

	Query struct {
		Root func(childComplexity int, num *int, rootInput *model.RootInput) int
		User func(childComplexity int, name string) int
	}

	User struct {
		Age     func(childComplexity int) int
		IsAdmin func(childComplexity int) int
		Name    func(childComplexity int) int
	}
}

type Config

type Config struct {
	Schema     *ast.Schema
	Resolvers  ResolverRoot
	Directives DirectiveRoot
	Complexity ComplexityRoot
}

type DirectiveRoot

type DirectiveRoot struct {
}

type MutationResolver

type MutationResolver interface {
	RegisterUser(ctx context.Context, name string) (bool, error)
}

type QueryResolver

type QueryResolver interface {
	User(ctx context.Context, name string) (*model.User, error)
	Root(ctx context.Context, num *int, rootInput *model.RootInput) (bool, error)
}

type ResolverRoot

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

type UserResolver

type UserResolver interface {
	Name(ctx context.Context, obj *model.User) (string, error)
	Age(ctx context.Context, obj *model.User) (*int, error)
}

Jump to

Keyboard shortcuts

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