bind

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2026 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Overview

Package bind lowers already-coerced GraphQL inputs into the existing P2/P3 request IR. Public GraphQL names are resolved exactly once against ContractIR; no name survives into authorization, planning, or SQL rendering.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Binder

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

func New

func New(compilation compilerir.CompilationIR, limits Limits) (*Binder, error)

func (*Binder) Child

func (b *Binder) Child(target compilerir.ModelID, field *ast.Field, selections []readir.Selection, variables map[string]any) (readir.Request, error)

Child compiles arguments on a selected to-many relation into a P3 request. It is suitable for selectset.Request.Child.

func (*Binder) Count

func (b *Binder) Count(target compilerir.ModelID, field *ast.Field, variables map[string]any) (readir.Request, error)

Count compiles the optional where argument on a relation count into the same P3 Count request used by generated Go callers.

func (*Binder) FreezePredicate

func (b *Binder) FreezePredicate(condition policyir.Condition) (golem.FrozenPredicate, error)

FreezePredicate converts an already-bound P2 condition into the frozen public predicate boundary shared by P3/P4 runtime adapters. Scalar parsing, enum GraphQL-name resolution, provider/operator validation, and resource limits have already run in Binder; the conversion preserves their exact value and stable-identity result without reinterpreting public names.

func (*Binder) MutationSelector

func (b *Binder) MutationSelector(modelID compilerir.ModelID, raw any) (readir.Selector, policyir.Condition, error)

MutationSelector binds a GraphQL unique-selector map without manufacturing a read projection. P5-E uses the same exact scalar and selector machinery as P5-C, then freezes the result at P4's mutation boundary.

func (*Binder) MutationValue

func (b *Binder) MutationValue(modelID compilerir.ModelID, fieldID compilerir.FieldID, raw any) (policyir.Value, error)

MutationValue applies the same exact GraphQL scalar/enum/list/JSON coercion used by P5-C filters, but returns P2's exact immutable value for P4 input binding. No public name or float64 approximation crosses this boundary.

func (*Binder) MutationWhere

func (b *Binder) MutationWhere(modelID compilerir.ModelID, raw any) (policyir.Condition, error)

MutationWhere binds a GraphQL batch/nested where map through the same P2 condition vocabulary, provider checks, exact values, and public limits as a P5-C read filter.

func (*Binder) Query

func (b *Binder) Query(input QueryInput) (readir.Request, error)

type Limits

type Limits struct {
	MaxInputDepth int
	MaxInputNodes int
	MaxListItems  int
	MaxPageSize   int
}

type QueryInput

type QueryInput struct {
	Operation  readir.Operation
	Model      compilerir.ModelID
	Arguments  map[string]any
	Selections []readir.Selection
}

Jump to

Keyboard shortcuts

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