Packages

Generate type-safe Gleam clients directly from your Ash resources and actions, ensuring end-to-end type safety between Gleam and Elixir.

Current section

Files

Jump to
ash_gleam doc AshGleam.Changeset.md
Raw

doc/AshGleam.Changeset.md

# `AshGleam.Changeset`
Builds an `Ash.Changeset` from a Gleam update-style action without persisting.
# `for_update`
```elixir
@spec for_update(struct(), atom(), map(), Keyword.t()) ::
{:ok, Ash.Changeset.t()} | {:error, term()}
```
Runs a Gleam action marked `update? true` and returns an `Ash.Changeset` ready for persistence.
## Options
* `:action` (required) - the Ash update action to build the changeset with
## Example
todo
|> AshGleam.Changeset.for_update(:mark_completed, %{}, action: :update)
|> Ash.update!()
---
*Consult [api-reference.md](api-reference.md) for complete listing*