You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The default_value for an enum must be present in the enum values.
Could not use default value of `[asc: :inserted_at]` for :project_order_by.
Valid values are:
* [desc: :inserted_at]
* [asc: :inserted_at]
The above call to List.wrap does nothing in case of [asc: :inserted_at], but then it uses Enum.all? and ends up checking if {:asc, :inserted_at} belongs to values instead of [asc: :inserted_at].
What is the reasoning behind using List.wrap? Edit: it was introduced in #762 to handle default value for list_of(enum).
Environment
Elixir version (elixir -v): Elixir 1.9.1 (compiled with Erlang/OTP 22)
Absinthe version (mix deps | grep absinthe): 1.5.1
The text was updated successfully, but these errors were encountered:
Given the following enum definition
and the following field with a default enum argument
I get the following error
Reason
absinthe/lib/absinthe/phase/schema/validation/default_enum_value_present.ex
Lines 37 to 38 in 00601ff
The above call to
List.wrap
does nothing in case of[asc: :inserted_at]
, but then it usesEnum.all?
and ends up checking if{:asc, :inserted_at}
belongs to values instead of[asc: :inserted_at]
.What is the reasoning behind using
List.wrap
?Edit: it was introduced in #762 to handle default value for
list_of(enum)
.Environment
The text was updated successfully, but these errors were encountered: