TypedGql.Generation.Context (TypedGql v0.13.0)

Copy Markdown View Source

Read-only context passed to TypedGql.Generation.Plugin callbacks.

Carries the schema and compile-time options the engine has available at every pipeline juncture. Per-node information (parent type, target module) lives on TypedGql.Generation.Schema nodes, not here.

:fragments maps a fragment name to the parsed TypedGql.Language.Fragment itself. Up to 0.12.2 the value was a map wrapping it (%{source:, fragment:, result_module:}); a plugin reading context.fragments[name].fragment has to read context.fragments[name] now. The wrapper's other keys were never usable from a plugin — generation is what produces the result module.

Summary

Types

t()

@type t() :: %TypedGql.Generation.Context{
  fragments: %{required(String.t()) => TypedGql.Language.Fragment.t()},
  scalar_types: %{required(String.t()) => module()},
  schema: TypedGql.Schema.t()
}