Skip to main content

Enums

An Enum is a special kind of scalar that is restricted to a particular set of allowed values. It can be used as both an input and an output type.

We can define enums like the following:

public enum UserRole
{
Guest,
Standard,
Administrator
}

public class Query
{
public User[] GetUsers(UserRole role)
{
// Omitted code for brevity
}
}