I am trying to learn the absinthe library and I am stuck how to get the enum values from a query.
I have this type definition
defmodule Qssite.Type.Gender do
use Absinthe.Schema.Notation
enum :gender do
value :ma
value :fe
value :co
end
end
and in my schema in the query I have
field :genders, list_of(:gender) do
# what can I put in the resolver?
# resolve &MySite.Resolver.Gender.all/2
end
I would like to do a query like
{
genders
}
and get back an array. I am reading the documentation but I can’t find an obvious way to do it.