Skip to content

Commit

Permalink
docs: Add Generic Action info on returning a list of resources (#1676)
Browse files Browse the repository at this point in the history
Co-authored-by: Chaz Watkins <chaz.watkins@ericsson.com>
  • Loading branch information
chazwatkins and Chaz Watkins authored Dec 25, 2024
1 parent cfd8cdc commit 8c1cec6
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions documentation/topics/actions/generic-actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,17 @@ end
> run # ...
> end
> ```
>
> For returning many instances of the resource, you can set your action's return type to
> `{:array, :struct}` and set the `items` constraint to the name of your resource.
>
> ```elixir
action :list_resources, {:array, :struct} do
constraints items: [instance_of: __MODULE__]
run # ...
end
> ```
## Calling Generic Actions
Expand Down

0 comments on commit 8c1cec6

Please sign in to comment.