Skip to main content

Dependent Fields

A dependent field is a purely output field whose value changes whenever at least one field it depends on is provided and accepted (e.g. username_last_updated_at should only update whenever username changes).

  • It must have either a default static value or a resolver for the default value.
  • It must depend on at least one other field - lax, required, virtual, or another dependent field (no circular dependencies).
  • It must have a resolver to generate new values whenever a parent field is provided and accepted.
  • It may use readonly to stop accepting further updates once its value differs from its default.
  • It may have on_delete and on_success event handlers.

Examples

Try it in the browser

value is a lax field with a default of 0. computed is a dependent field that equals value + 1 (with its own fallback default of 1).

Loading playground…