directive

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: May 19, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrStopExecutionWithoutError = fmt.Errorf("stop execution without error")

ErrStopExecutionWithoutError can be returned from directive.Execute and works like "break" in for loops but on directives chain

Functions

This section is empty.

Types

type Arguments

type Arguments map[string]ast.Value

type ConstructorFun

type ConstructorFun = func(args Arguments, nodeKind string) (Directive, error)

type Definition

type Definition struct {
	// contains filtered or unexported fields
}

func NewDirectiveDefinition

func NewDirectiveDefinition(name string, constructor ConstructorFun) Definition

func (Definition) Construct

func (d Definition) Construct(arguments Arguments, node ast.Node) (Directive, error)

func (Definition) Name

func (d Definition) Name() string

type Directive

type Directive interface {
	Execute(
		ctx context.Context,
		source interface{},
		resolvedValue interface{},
		fieldArgs map[string]interface{},
	) (interface{}, context.Context, error) // resolved value with updated context or error
}

Jump to

Keyboard shortcuts

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