AshGrant.Transformers.AddArgumentResolvers (AshGrant v0.14.1)

Copy Markdown View Source

Spark DSL transformer that wires up resolve_argument declarations.

For every resolve_argument :name, from_path: [...] declaration:

  1. Validates the path at compile time (intermediates are belongs_to, leaf is an attribute).
  2. Validates that at least one scope references ^arg(:name) in its resolved filter (rejecting dead declarations).
  3. For every targeted write action (:create, :update, :destroy, or the explicit :for_actions list), injects:
    • an argument :name, <type>, allow_nil?: true with the type inferred from the leaf attribute (if the action does not already declare it)
    • a change {AshGrant.Changes.ResolveArgument, [name:, path:, scopes_needing:]} with scopes_needing computed at compile time

Summary

Functions

after_compile?()

Callback implementation for Spark.Dsl.Transformer.after_compile?/0.