selected

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: BSD-2-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultMaxSelections = 100_000

DefaultMaxSelections bounds the number of selections processed while flattening one operation. Fragment spreads are expanded by value, so a chain of fragments can otherwise grow exponentially with document size.

Variables

View Source
var ErrTooManySelections = stderrors.New("too many selections")

ErrTooManySelections is wrapped by the error returned when an operation expands to more selections than allowed.

Functions

func HasAsyncSel

func HasAsyncSel(sels []Selection) bool

Types

type Request

type Request struct {
	Schema             *ast.Schema
	Doc                *ast.ExecutableDefinition
	Vars               map[string]any
	Mu                 sync.Mutex
	Errs               []*errors.QueryError
	AllowIntrospection bool

	// MaxSelections caps the number of selections processed while flattening
	// the operation. Zero or a negative value means DefaultMaxSelections.
	MaxSelections int
	// contains filtered or unexported fields
}

func (*Request) AddError

func (r *Request) AddError(err *errors.QueryError)

type SchemaField

type SchemaField struct {
	resolvable.Field
	Alias       string
	Args        map[string]any
	PackedArgs  reflect.Value
	Sels        []Selection
	Async       bool
	FixedResult reflect.Value
}

func (*SchemaField) Resolve added in v1.6.0

func (f *SchemaField) Resolve(ctx context.Context, resolver reflect.Value) (reflect.Value, error)

type Selection

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

func ApplyOperation

func ApplyOperation(r *Request, s *resolvable.Schema, op *ast.OperationDefinition) (sels []Selection, err *errors.QueryError)

type TypeAssertion

type TypeAssertion struct {
	resolvable.TypeAssertion
	Sels []Selection
}

type TypenameField

type TypenameField struct {
	resolvable.Object
	Alias string
}

Jump to

Keyboard shortcuts

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