Documentation
¶
Index ¶
- type DocProvider
- func (p *DocProvider) DefinitionExtensions(_ context.Context, name string) iter.Seq[*ast.Definition]
- func (p *DocProvider) Definitions(_ context.Context) iter.Seq[*ast.Definition]
- func (p *DocProvider) Description(_ context.Context) string
- func (p *DocProvider) DirectiveDefinitions(_ context.Context) iter.Seq2[string, *ast.DirectiveDefinition]
- func (p *DocProvider) DirectiveForName(_ context.Context, name string) *ast.DirectiveDefinition
- func (p *DocProvider) Extensions(_ context.Context) iter.Seq[*ast.Definition]
- func (p *DocProvider) ForName(_ context.Context, name string) *ast.Definition
- func (p *DocProvider) Implements(_ context.Context, name string) iter.Seq[*ast.Definition]
- func (p *DocProvider) MutationType(_ context.Context) *ast.Definition
- func (p *DocProvider) PossibleTypes(_ context.Context, name string) iter.Seq[*ast.Definition]
- func (p *DocProvider) QueryType(_ context.Context) *ast.Definition
- func (p *DocProvider) SubscriptionType(_ context.Context) *ast.Definition
- func (p *DocProvider) Types(_ context.Context) iter.Seq2[string, *ast.Definition]
- type Provider
- func (p *Provider) Definitions(_ context.Context) iter.Seq[*ast.Definition]
- func (p *Provider) Description(_ context.Context) string
- func (p *Provider) DirectiveDefinitions(_ context.Context) iter.Seq2[string, *ast.DirectiveDefinition]
- func (p *Provider) DirectiveForName(_ context.Context, name string) *ast.DirectiveDefinition
- func (p *Provider) ForName(_ context.Context, name string) *ast.Definition
- func (p *Provider) Implements(_ context.Context, name string) iter.Seq[*ast.Definition]
- func (p *Provider) MutationType(_ context.Context) *ast.Definition
- func (p *Provider) PossibleTypes(_ context.Context, name string) iter.Seq[*ast.Definition]
- func (p *Provider) QueryType(_ context.Context) *ast.Definition
- func (p *Provider) Schema() *ast.Schema
- func (p *Provider) SubscriptionType(_ context.Context) *ast.Definition
- func (p *Provider) Types(_ context.Context) iter.Seq2[string, *ast.Definition]
- func (p *Provider) ValidateSchema() []error
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 ¶
func (p *DocProvider) Types(_ context.Context) iter.Seq2[string, *ast.Definition]
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 ¶
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 ¶
NewWithSchema creates a Provider wrapping the given compiled schema.
func (*Provider) Definitions ¶
func (*Provider) DirectiveDefinitions ¶
func (*Provider) DirectiveForName ¶
func (*Provider) Implements ¶
func (*Provider) MutationType ¶
func (p *Provider) MutationType(_ context.Context) *ast.Definition
func (*Provider) PossibleTypes ¶
func (*Provider) 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) ValidateSchema ¶
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.