From cf4dd38e39ac3c67330ebf8702d5f0ed2894bd9e Mon Sep 17 00:00:00 2001 From: Barnabas Jovanovics Date: Tue, 17 Jan 2023 15:40:33 +0100 Subject: [PATCH] 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 --- documentation/how_to/use-enums-with-graphql.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/documentation/how_to/use-enums-with-graphql.md b/documentation/how_to/use-enums-with-graphql.md index bd7950c..36efa69 100644 --- a/documentation/how_to/use-enums-with-graphql.md +++ b/documentation/how_to/use-enums-with-graphql.md @@ -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`.