Help us shape the future of Go! Take the 2026 Go Developer Survey

server

package
v0.17.96 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: MIT Imports: 16 Imported by: 3

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.

func UnmarshalDateFilter added in v0.17.96

func UnmarshalDateFilter(ctx context.Context, raw any) (models.DateFilter, error)

UnmarshalDateFilter unmarshals raw into the DateFilter input type, using the unmarshaler bound to ctx's request. Call it from a resolver to decode an input object that was not passed as a field argument.

ctx must come from a gqlgen request; outside one there is no unmarshaler to use and the returned error says so.

func UnmarshalListCoercion added in v0.17.96

func UnmarshalListCoercion(ctx context.Context, raw any) (models.ListCoercion, error)

UnmarshalListCoercion unmarshals raw into the ListCoercion input type, using the unmarshaler bound to ctx's request. Call it from a resolver to decode an input object that was not passed as a field argument.

ctx must come from a gqlgen request; outside one there is no unmarshaler to use and the returned error says so.

Types

type ComplexityRoot

type ComplexityRoot struct {
	Element struct {
		Child      func(childComplexity int) int
		Error      func(childComplexity int) int
		Mismatched func(childComplexity int) int
	}

	Query struct {
		Coercion     func(childComplexity int, value []*models.ListCoercion) int
		Complexity   func(childComplexity int, value int) int
		Date         func(childComplexity int, filter models.DateFilter) int
		Error        func(childComplexity int, typeArg *models.ErrorType) int
		JSONEncoding func(childComplexity int) int
		Path         func(childComplexity int) int
		Viewer       func(childComplexity int) int
	}

	RemoteModelWithOmitempty struct {
		Description func(childComplexity int) int
	}

	User struct {
		Likes       func(childComplexity int) int
		Name        func(childComplexity int) int
		PhoneNumber func(childComplexity int) int
		Query       func(childComplexity int) int
	}

	Viewer struct {
		User func(childComplexity int) int
	}
}

type CustomError

type CustomError struct {
	UserMessage   string
	InternalError string
}

func (*CustomError) Error

func (e *CustomError) Error() string

type DirectiveRoot

type DirectiveRoot struct {
	Magic func(ctx context.Context, obj any, next graphql.Resolver, kind *int) (res any, err error)
}

type ElementResolver

type ElementResolver interface {
	Child(ctx context.Context, obj *models.Element) (*models.Element, error)
	Error(ctx context.Context, obj *models.Element) (bool, error)
	Mismatched(ctx context.Context, obj *models.Element) ([]bool, error)
}

type QueryResolver

type QueryResolver interface {
	Path(ctx context.Context) ([]*models.Element, error)
	Date(ctx context.Context, filter models.DateFilter) (bool, error)
	Viewer(ctx context.Context) (*models.Viewer, error)
	JSONEncoding(ctx context.Context) (string, error)
	Error(ctx context.Context, typeArg *models.ErrorType) (bool, error)
	Complexity(ctx context.Context, value int) (bool, error)
	Coercion(ctx context.Context, value []*models.ListCoercion) (bool, error)
}

type Resolver

type Resolver struct{}

func (*Resolver) Element

func (r *Resolver) Element() ElementResolver

func (*Resolver) Query

func (r *Resolver) Query() QueryResolver

func (*Resolver) User

func (r *Resolver) User() UserResolver

type ResolverRoot

type ResolverRoot interface {
	Element() ElementResolver
	Query() QueryResolver
	User() UserResolver
}

type UserResolver

type UserResolver interface {
	Likes(ctx context.Context, obj *remote_api.User) ([]string, error)
}

Directories

Path Synopsis
cmd
integration command

Jump to

Keyboard shortcuts

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