TypedGql.Generation.Field (typedGql v0.11.0)

Copy Markdown View Source

A single generated schema field, before lowering to EctoTypedSchema AST.

Promotes the inputs of the type generator's field building into a struct so lifecycle plugins can read GraphQL context (query_field/schema_field) and mutate generation intent (e.g. set resolved.nullable to true).

Lowering rebuilds the field tuple from resolved plus the names via TypedGql.GeneratorHelpers, so a plugin mutating resolved flows through naturally.

Summary

Functions

Sets the field's nullability, mutating resolved.nullable.

Types

kind()

@type kind() :: :field | :embeds_one | :embeds_many

t()

@type t() :: %TypedGql.Generation.Field{
  embed_module: module() | nil,
  kind: kind(),
  name: atom(),
  original_name: String.t(),
  query_field: TypedGql.Language.Field.t(),
  resolved: TypedGql.TypeMapper.resolve_result(),
  schema_field: TypedGql.Schema.Field.t()
}

Functions

put_nullable(field, nullable)

@spec put_nullable(t(), boolean()) :: t()

Sets the field's nullability, mutating resolved.nullable.