static

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCascadeDependency = errors.New("cannot drop catalog with dependent definitions without cascade")

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 implements schema.Provider backed by *ast.Schema. All lookups are O(1) via maps.

func New

func New() (*Provider, error)

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) DropCatalog

func (p *Provider) DropCatalog(ctx context.Context, name string, cascade bool) error

Drops catalog schema objects from the provider. For static provider, this means dropping all definitions with the given catalog name.

func (*Provider) DropDefinition

func (p *Provider) DropDefinition(ctx context.Context, name string) error

func (*Provider) DropEnumValue

func (p *Provider) DropEnumValue(ctx context.Context, typeName, valueName string) error

func (*Provider) DropField

func (p *Provider) DropField(ctx context.Context, typeName, fieldName string) error

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) SetCatalogDescription

func (p *Provider) SetCatalogDescription(_ context.Context, _, _, _ string) error

func (*Provider) SetDefinitionDescription

func (p *Provider) SetDefinitionDescription(_ context.Context, name, desc, _ string) error

func (*Provider) SetFieldDescription

func (p *Provider) SetFieldDescription(_ context.Context, typeName, fieldName, desc, _ string) error

func (*Provider) SetModuleDescription

func (p *Provider) SetModuleDescription(_ context.Context, _, _, _ string) error

func (*Provider) SubscriptionType

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

func (*Provider) Types

func (*Provider) Update

func (p *Provider) Update(ctx context.Context, changes base.DefinitionsSource) error

Update applies DDL changes to the provider's schema. The changes source provides definitions (add/drop/replace) and optionally extensions (field/directive/description modifications on existing 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