resolvable

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2025 License: BSD-2-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Query        = "Query"
	Mutation     = "Mutation"
	Subscription = "Subscription"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Field

type Field struct {
	ast.FieldDefinition
	TypeName    string
	MethodIndex int
	FieldIndex  []int
	HasContext  bool
	HasError    bool
	IsFieldFunc bool
	ArgsPacker  *packer.StructPacker
	ValueExec   Resolvable
	TraceLabel  string
}

func (*Field) Resolve added in v1.6.0

func (f *Field) Resolve(ctx context.Context, resolver reflect.Value, args interface{}) (output interface{}, err error)

func (*Field) UseMethodResolver

func (f *Field) UseMethodResolver() bool

type List

type List struct {
	Elem Resolvable
}

type Meta

type Meta struct {
	FieldSchema   Field
	FieldType     Field
	FieldTypename Field
	FieldService  Field
	Schema        *Object
	Type          *Object
	Service       *Object
}

Meta defines the details of the metadata schema for introspection.

type Object

type Object struct {
	Name           string
	Fields         map[string]*Field
	TypeAssertions map[string]*TypeAssertion
	Interfaces     map[string]struct{}
}

type Resolvable

type Resolvable interface {
	// contains filtered or unexported methods
}

type Scalar

type Scalar struct{}

type Schema

type Schema struct {
	*Meta
	ast.Schema
	Query                Resolvable
	Mutation             Resolvable
	Subscription         Resolvable
	QueryResolver        reflect.Value
	MutationResolver     reflect.Value
	SubscriptionResolver reflect.Value
}

func ApplyResolver

func ApplyResolver(s *ast.Schema, resolver interface{}, useFieldResolvers bool) (*Schema, error)

type TypeAssertion

type TypeAssertion struct {
	MethodIndex int
	TypeExec    Resolvable
}

Jump to

Keyboard shortcuts

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