angee.graphql.sdl
On-disk GraphQL schema artifact emission, checks, and drift detection.
:class:GraphQLSdl is the schema counterpart of :class:angee.compose.runtime.Runtime: it owns where generated schema artifacts live (runtime/schemas/<name>.graphql and runtime/schemas/<name>.metadata.json), renders them from the discovered :class:~angee.graphql.schema.GraphQLSchemas, and reconciles disk against that render. The schema management command and the dev-serve boot hook (:mod:angee.asgi) both delegate here, so the write/check/drift logic lives once.
GraphQLSdl
class GraphQLSdl()Render, write, and check generated GraphQL artifacts for each schema.
__init__
def __init__(schemas: GraphQLSchemas, *, schema_dir: Path) -> NoneCreate a schema artifact owner over schemas writing under schema_dir.
from_discovery
@classmethod
def from_discovery(cls) -> GraphQLSdlReturn a schema artifact owner over discovered schemas and the runtime dir.
render
def render() -> dict[str, str]Return printed SDL per schema name (the single source of truth).
render_metadata
def render_metadata() -> dict[str, dict[str, object]]Return JSON-safe schema metadata per schema name.
emit
def emit() -> NoneReconcile the owned schema directory to the rendered schemas.
emit_if_stale
def emit_if_stale() -> boolReconcile drifted schema artifacts and orphans; return whether any changed.
Mirrors :meth:angee.compose.runtime.Runtime.emit_if_stale: drift-gated, idempotent, and converges the owned directory to the render.
check
def check() -> NoneRaise when on-disk schema artifacts differ from the render.