mirror of
https://github.com/ash-project/ash_graphql.git
synced 2024-09-19 21:03:09 +12:00
docs: Fix constraints example in enum how_to (#51)
The Code Snippet gave me a compile error, telling me that `one_of` was not a valid options
This commit is contained in:
parent
c0f5f596cb
commit
cf4dd38e39
1 changed files with 3 additions and 1 deletions
|
@ -6,7 +6,9 @@ Enums are implemented automatically for any `atom` *attribute* (not arguments) w
|
|||
|
||||
```elixir
|
||||
# On the resource of type `:ticket`
|
||||
attribute :type, :atom, one_of: [:foo, :bar, :baz]
|
||||
attribute :type, :atom do
|
||||
constraints one_of: [:foo, :bar, :baz]
|
||||
end
|
||||
```
|
||||
|
||||
This would produce an enum called `:ticket_type`/`TicketType`.
|
||||
|
|
Loading…
Reference in a new issue