graphql

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithOperationContext

func WithOperationContext(ctx context.Context, rc *OperationContext) context.Context

Types

type CollectedField

type CollectedField struct {
	*ast.Field

	Selections ast.SelectionSet
}

func CollectFields

func CollectFields(reqCtx *OperationContext, selSet ast.SelectionSet, satisfies []string) []CollectedField

CollectFields returns the set of fields from an ast.SelectionSet where all collected fields satisfy at least one of the GraphQL types passed through satisfies. Providing an empty or nil slice for satisfies will return collect all fields regardless of fragment type conditions.

type FieldSet

type FieldSet struct {
	Values []gql.Marshaler
	// contains filtered or unexported fields
}

func NewFieldSet

func NewFieldSet(fields []CollectedField) *FieldSet

func (*FieldSet) Concurrently

func (m *FieldSet) Concurrently(i int, f func() gql.Marshaler)

func (*FieldSet) Dispatch

func (m *FieldSet) Dispatch()

func (*FieldSet) MarshalGQL

func (m *FieldSet) MarshalGQL(writer io.Writer)

type OperationContext

type OperationContext struct {
	RawQuery      string
	Variables     map[string]interface{}
	OperationName string
	Doc           *ast.QueryDocument

	Operation *ast.OperationDefinition
}

func GetOperationContext

func GetOperationContext(ctx context.Context) *OperationContext

func (*OperationContext) Validate

func (c *OperationContext) Validate(ctx context.Context) error

Jump to

Keyboard shortcuts

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