View Source GraphQLDocument.Enum (GraphQLDocument v0.2.0)
Enums can be defined in the Type System side of GraphQL.
For the purposes of making GraphQL requests, you can express Enum Values as Values given in Arguments.
Enums are expressed as atoms.
You can use any valid atom syntax, such as
Person
or:Person
or:"Person"
.However, all enums must be valid GraphQL Names. See
GraphQLDocument.Name
.
See render/1
for examples.
Link to this section Summary
Functions
Return an Enum as iodata to be inserted into a Document.
Link to this section Types
@type t() :: atom()
Enums are specified as atoms. They must be a valid GraphQL Name.
(See GraphQLDocument.Name
)
Link to this section Functions
Return an Enum as iodata to be inserted into a Document.
examples
Examples
iex> render(User)
"User"
iex> render(:User)
"User"
iex> render(:user)
"user"
iex> render(:_user)
"_user"
iex> render(:__user__)
"__user__"
iex> render(:"--user--")
** (ArgumentError) --user-- is not a valid GraphQL name