relay

package
v5.10.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2019 License: MIT, MIT, MIT, + 2 more Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NodeRegister

type NodeRegister map[string][]NodeResolver

NodeRegister stores list of node resolvers

func (NodeRegister) Lookup

func (register NodeRegister) Lookup(components globalid.Components) *NodeResolver

Lookup given parsed globalid return valid resolver.

func (NodeRegister) RegisterResolver

func (register NodeRegister) RegisterResolver(resolver NodeResolver)

RegisterResolver registers a new node resolver and adds it to the register

type NodeResolver

type NodeResolver struct {
	ObjectType graphql.Type
	Translator globalid.Translator

	Resolve  func(NodeResolverParams) (interface{}, error)
	IsKindOf func(globalid.Components) bool
}

A NodeResolver describes an object that contains a globally unique ID.

type NodeResolverParams

type NodeResolverParams struct {
	// Context ...
	Context context.Context
	// IDComponents is the individual components of the given global ID
	IDComponents globalid.Components
	// Info is a collection of information about the current execution state.
	Info graphql.ResolveInfo
}

NodeResolverParams parameters to given to resolve method

Jump to

Keyboard shortcuts

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