We're transitioning Studio from Beta to Early Availability
Hygraph
Docs

You are currently reading the Studio Docs. If you were looking for the Classic Docs check here

Enumerations

#Overview

An enumeration (or enum for short) can be used to group values within a type. Enums can be useful to filter, and define certain content entries in your project.

For example, a product model may contain the enum COMMODITY, and values Digital and Physical.

Enums values can only contain alphanumeric characters, and underscores.

Learn more about Enumerations.

#Fetching enumeration values

You may want to fetch all possible values of an Enum you have created. You can do this via GraphQL using your projects API endpoint.

{
__type(name: "COMMODITY") {
enumValues {
name
}
}
}

#Enumerations in the UI