AshGrant.Transformers.ResolveFieldGroupFields (AshGrant v0.16.0)

Copy Markdown View Source

Resolves :all and deprecated [:*] wildcard in field group fields to concrete attribute names.

When a field group uses :all as its fields value, this transformer expands it to all public resource attributes, then removes any fields listed in the except option.

Examples

# Resolves to all attributes
field_group :everything, :all

# Resolves to all attributes except :salary and :ssn
field_group :public, :all, except: [:salary, :ssn]

Deprecation

The [:*] syntax is deprecated in favor of :all and will be removed in v1.0.0. Using [:*] emits a compile-time warning and is treated as :all internally.

Validations

  • except without :all (or deprecated [:*]) raises a compile error
  • Fields in except that don't exist as resource attributes raise a compile error
  • Masked fields that appear in except raise a compile error

This transformer must run BEFORE ValidateFieldGroups so that resolved fields are validated normally by downstream transformers.

Summary

Functions

after_compile?()

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