methods

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2026 License: GPL-3.0 Imports: 26 Imported by: 0

Documentation

Overview

Package methods type-checks and statically interprets GolemModel and GraphQL extension declarations.

The interpreter consumes generated descriptor overlays; it never executes application code and never recovers meaning by reparsing source text.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Dir             string
	ModulePath      string
	Env             []string
	Compilation     ir.CompilationIR
	Packages        []modelcodegen.PackageSpec
	Bootstrap       modelcodegen.Result
	Registry        *schemaexpr.Registry
	IDRegistry      *ir.IDRegistry
	GolemImportPath string
}

Config contains the resolved model graph and the package locations needed to type-check the registered model packages on a clean checkout.

type RelationOptionDeclaration

type RelationOptionDeclaration struct {
	ModelID       ir.ModelID
	RelationID    ir.RelationID
	RelationField ir.FieldID
	OnUpdate      *ir.ReferentialAction
	OnDelete      *ir.ReferentialAction
	Provider      ir.ProviderScope
	Span          ir.SourceSpan
}

RelationOptionDeclaration is kept separate from keyindex input because relation linking owns foreign-key construction.

type Result

type Result struct {
	Advanced              []keyindex.AdvancedModelDeclarations
	RelationOptions       []RelationOptionDeclaration
	OptimisticConcurrency []compilerconcurrency.Declaration
	GraphQLModels         []graphqlcontract.ModelPatch
	GraphQLComputed       []graphqlextension.ComputedDeclaration
	GraphQLCustom         []graphqlextension.CustomOperationDeclaration
	AnalyticsModels       []analyticscontract.ModelPatch
	Extensions            []ir.ProviderExtensionIR
	Diagnostics           []ir.Diagnostic
}

func Interpret

func Interpret(ctx context.Context, config Config) Result

Interpret loads every registered model and schema package with the fresh generated overlay, type-checks it, and interprets each exact GolemModel, model DefineGraphQL, and schema DefineGraphQL declaration.

Jump to

Keyboard shortcuts

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