Processes requested fields for Ash resources, determining which fields should be selected vs loaded, and building extraction templates for result processing.
This module handles different action types:
- CRUD actions (:read, :create, :update, :destroy) return resource records
- Generic actions (:action) return arbitrary types as specified in their
returnsfield
Architecture
Delegates to FieldSelector, which uses a unified type-driven recursive
dispatch pattern (similar to ValueFormatter). Each type is self-describing
via {type, constraints}, so no separate classification step is needed.
Manifest module
Field selection needs lookups (resources, actions, types) that live on
an AshTypescript.Manifest module's persisted Spark DSL state.
process/4 accepts an optional manifest module — when omitted, defaults to
the configured production manifest module. Verifiers running against an
inline test manifest pass their own module.
Summary
Functions
Atomizes requested fields by converting standalone strings to atoms and map keys to atoms.
Processes requested fields for a given resource and action.
Functions
Atomizes requested fields by converting standalone strings to atoms and map keys to atoms.
Processes requested fields for a given resource and action.
Returns {:ok, {select_fields, load_fields, extraction_template}} or {:error, error}.