Defining Enums
Preparing your DB schema and EzQL configuration file
For defining Enums in your GraphQL API you need to setup DB columns and an ezql.yml
configuration file in the following way.
Let's define User.role
field which allows a USER
or ADMIN
role.
Resulting Model Enum
Use custom value mapping for enum
With the example above, the enum column's value will be the index
of each value. eg: "user = 0", "admin = 1". If you want to control what value will be used for each Enum value you can use a Map(key & value) style configuration.