static

package
v0.3.42 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DocProvider

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

DocProvider is a read-only Provider backed by an *ast.SchemaDocument. ForName is O(n) linear scan — suitable for compilation, not runtime.

func NewDocumentProvider

func NewDocumentProvider(doc *ast.SchemaDocument) *DocProvider

NewDocumentProvider creates a DocProvider from an *ast.SchemaDocument.

func (*DocProvider) DefinitionExtensions

func (p *DocProvider) DefinitionExtensions(_ context.Context, name string) iter.Seq[*ast.Definition]

func (*DocProvider) Definitions

func (p *DocProvider) Definitions(_ context.Context) iter.Seq[*ast.Definition]

func (*DocProvider) Description

func (p *DocProvider) Description(_ context.Context) string

func (*DocProvider) DirectiveDefinitions

func (p *DocProvider) DirectiveDefinitions(_ context.Context) iter.Seq2[string, *ast.DirectiveDefinition]

func (*DocProvider) DirectiveForName

func (p *DocProvider) DirectiveForName(_ context.Context, name string) *ast.DirectiveDefinition

func (*DocProvider) Extensions

func (p *DocProvider) Extensions(_ context.Context) iter.Seq[*ast.Definition]

func (*DocProvider) ForName

func (p *DocProvider) ForName(_ context.Context, name string) *ast.Definition

func (*DocProvider) Implements

func (p *DocProvider) Implements(_ context.Context, name string) iter.Seq[*ast.Definition]

func (*DocProvider) MutationType

func (p *DocProvider) MutationType(_ context.Context) *ast.Definition

func (*DocProvider) PossibleTypes

func (p *DocProvider) PossibleTypes(_ context.Context, name string) iter.Seq[*ast.Definition]

func (*DocProvider) QueryType

func (p *DocProvider) QueryType(_ context.Context) *ast.Definition

func (*DocProvider) SubscriptionType

func (p *DocProvider) SubscriptionType(_ context.Context) *ast.Definition

func (*DocProvider) Types

type Provider

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

Provider is a READ-ONLY view of an *ast.Schema, all lookups O(1) via maps.

In the engine there is exactly one: the system prelude the catalog storage layers its on-the-fly generation on top of (store.go). That prelude is a binary artifact — scalars, introspection, the @system SDL — so mutating it would be process-local state no restart and no second node would share. Descriptions in particular are NOT curated here: curation lives in catalog.annotations and is applied by the storage at reconstruction time.

The mutable surface this type used to carry (Update, DropCatalog, the description setters) went with the compiler write path in design-036. It had stopped satisfying the annotator interfaces long before that — the setters were a 2-of-3 and a 1-of-6 match — so nothing could reach it even by assertion.

func New

func New() (*Provider, error)

New builds the system prelude and CHECKS it. The prelude is parsed from SDL embedded in the binary, so a dangling type reference in it is a build-time mistake that would otherwise surface far away, as odd introspection output. Failing here names it.

func NewWithSchema

func NewWithSchema(s *ast.Schema) *Provider

NewWithSchema creates a Provider wrapping the given compiled schema.

func (*Provider) Definitions

func (p *Provider) Definitions(_ context.Context) iter.Seq[*ast.Definition]

func (*Provider) Description

func (p *Provider) Description(_ context.Context) string

func (*Provider) DirectiveDefinitions

func (p *Provider) DirectiveDefinitions(_ context.Context) iter.Seq2[string, *ast.DirectiveDefinition]

func (*Provider) DirectiveForName

func (p *Provider) DirectiveForName(_ context.Context, name string) *ast.DirectiveDefinition

func (*Provider) ForName

func (p *Provider) ForName(_ context.Context, name string) *ast.Definition

func (*Provider) Implements

func (p *Provider) Implements(_ context.Context, name string) iter.Seq[*ast.Definition]

func (*Provider) MutationType

func (p *Provider) MutationType(_ context.Context) *ast.Definition

func (*Provider) PossibleTypes

func (p *Provider) PossibleTypes(_ context.Context, name string) iter.Seq[*ast.Definition]

func (*Provider) QueryType

func (p *Provider) QueryType(_ context.Context) *ast.Definition

func (*Provider) Schema

func (p *Provider) Schema() *ast.Schema

Schema returns the underlying ast.Schema for direct access (e.g., comparison tests).

func (*Provider) SubscriptionType

func (p *Provider) SubscriptionType(_ context.Context) *ast.Definition

func (*Provider) Types

func (*Provider) ValidateSchema

func (p *Provider) ValidateSchema() []error

ValidateSchema checks that all type references in the schema are resolvable. Returns a list of validation errors. An empty slice means the schema is valid. This is intended for use in tests, not in production runtime.

Jump to

Keyboard shortcuts

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