Documentation
¶
Index ¶
- Variables
- 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) DropCatalog(ctx context.Context, name string, cascade bool) error
- func (p *Provider) DropDefinition(ctx context.Context, name string) error
- func (p *Provider) DropEnumValue(ctx context.Context, typeName, valueName string) error
- func (p *Provider) DropField(ctx context.Context, typeName, fieldName string) error
- 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) SetCatalogDescription(_ context.Context, _, _, _ string) error
- func (p *Provider) SetDefinitionDescription(_ context.Context, name, desc, _ string) error
- func (p *Provider) SetFieldDescription(_ context.Context, typeName, fieldName, desc, _ string) error
- func (p *Provider) SetModuleDescription(_ context.Context, _, _, _ string) error
- func (p *Provider) SubscriptionType(_ context.Context) *ast.Definition
- func (p *Provider) Types(_ context.Context) iter.Seq2[string, *ast.Definition]
- func (p *Provider) Update(ctx context.Context, changes base.DefinitionsSource) error
- func (p *Provider) ValidateSchema() []error
Constants ¶
This section is empty.
Variables ¶
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 ¶
func (p *DocProvider) Types(_ context.Context) iter.Seq2[string, *ast.Definition]
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 NewWithSchema ¶
NewWithSchema creates a Provider wrapping the given compiled schema.
func (*Provider) Definitions ¶
func (*Provider) DirectiveDefinitions ¶
func (*Provider) DirectiveForName ¶
func (*Provider) DropCatalog ¶
Drops catalog schema objects from the provider. For static provider, this means dropping all definitions with the given catalog name.
func (*Provider) DropDefinition ¶
func (*Provider) DropEnumValue ¶
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) SetCatalogDescription ¶
func (*Provider) SetDefinitionDescription ¶
func (*Provider) SetFieldDescription ¶
func (*Provider) SetModuleDescription ¶
func (*Provider) SubscriptionType ¶
func (p *Provider) SubscriptionType(_ context.Context) *ast.Definition
func (*Provider) Update ¶
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 ¶
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.