Frequently Asked Questions

Features & Capabilities

What are enumerations in Hygraph and how are they used?

Enumerations in Hygraph are predefined sets of values that represent a list of possible options for a field, such as product size or color. They are used to create dropdown menus in your content models, ensuring only predefined values are selected during content creation. This helps maintain data consistency and simplifies workflows, especially for e-commerce projects where you want to restrict entries to specific sizes or colors.
Source: Configure Enumerations Guide

How do I configure enumerations in Hygraph?

To configure enumerations in Hygraph:

  1. In the Schema editor, click +Add next to Enumerations.
  2. Enter a Display name (e.g., Clothes size).
  3. Enter an API ID (e.g., ClothesSize).
  4. Optionally, add a Description.
  5. Add enumeration values by entering each value's display name (e.g., XS, S, M, L, XL for clothes sizes). The API ID will autocomplete.
  6. Click Add Enumeration to finish.
These enumerations can then be used in dropdown fields for your models.
Source: Configure Enumerations Guide

Can you provide examples of enumeration values for common use cases?

Yes, here are examples of enumeration values for typical e-commerce scenarios:

These can be configured as enumerations and used in dropdown fields to ensure only valid options are selected.
Source: Configure Enumerations Guide

How do enumerations improve data consistency and workflow in Hygraph?

Enumerations ensure that only predefined values are used for specific fields, such as product size or color. This prevents errors and inconsistencies, streamlines content creation, and makes it easier for teams to manage large catalogs or complex data sets. By restricting choices to valid options, enumerations help maintain high data quality and simplify approval workflows.
Source: Configure Enumerations Guide

Implementation & Getting Started

What is the first step to configure enumerations in Hygraph?

The first step is to open the Schema editor in your Hygraph project and click +Add next to Enumerations. From there, you can define the display name, API ID, and add enumeration values.
Source: Configure Enumerations Guide

Can I use enumerations in component fields in Hygraph?

Yes, enumerations can be used as parts of component fields in Hygraph. This allows you to create structured dropdowns for selecting predefined values within components, which is especially useful for managing product attributes like size and color in e-commerce projects.
Source: Configure Enumerations Guide

Use Cases & Benefits

Who can benefit from using enumerations in Hygraph?

Enumerations are especially beneficial for businesses managing structured data, such as e-commerce companies needing to standardize product attributes (sizes, colors), or any organization that requires consistent data entry for cataloging, filtering, or reporting. Teams looking to streamline workflows and reduce errors in content creation will find enumerations valuable.
Source: Configure Enumerations Guide

How do enumerations support e-commerce workflows in Hygraph?

In e-commerce workflows, enumerations allow you to restrict product entries to specific sizes and colors, ensuring only valid options are published. This helps maintain catalog consistency, simplifies filtering and searching, and reduces manual errors during content creation.
Source: Configure Enumerations Guide

Technical Requirements & Documentation

Where can I find detailed documentation on configuring enumerations in Hygraph?

You can find step-by-step instructions and examples for configuring enumerations in Hygraph in the official documentation: Configure Enumerations Guide.

Can I use enumerations with the API Playground in Hygraph?

Yes, after configuring enumerations, you can access them via their API IDs in the API Playground. This allows you to query and manage enumeration values programmatically, supporting advanced integrations and automation.
Source: Configure Enumerations Guide

Support & Troubleshooting

What support resources are available if I encounter issues configuring enumerations?

Hygraph offers extensive documentation, real-time chat support via Intercom, a community Slack channel (join here), and 24/7 support for troubleshooting. You can also access guides and tutorials at Hygraph Documentation for self-paced learning and troubleshooting.

Security & Compliance

Does Hygraph offer security and compliance features for managing enumerations and other data?

Yes, Hygraph is SOC 2 Type 2 compliant (since August 3rd, 2022), ISO 27001 certified, and GDPR compliant. It offers granular permissions, SSO integrations, audit logs, encryption at rest and in transit, and regular backups to ensure data security and compliance. For more details, visit the security features page.

Help teams manage content creation and approval in a clear and structured way
Hygraph
Docs

#2.2 Configure enumerations

#Overview

When we create product entries for our e-commerce, we want to be able to select values - such as product size or color - from a dropdown menu. This makes sense for our project because we want to be able to only publish products in certain colors & sizes. Making this a dropdown in our content creation screen ensures that only the values we predefine will be used for those product characteristics.

In Hygraph, you do this by adding a dropdown menu to your model. This dropdown gets the list of values from an enumeration that you need to configure before you create the dropdown field.

An enumeration is a predefined set of values that represents a list of possible options. We can use enumerations to group values within a type and then use them when we add a dropdown field.

We will be using enumerations for the components that we are going to create in our next lesson. Let's configure them.

#Configure enumerations

Adding enumerations is very simple.

Adding enumerationsAdding enumerations

We always add them in the same way:

  1. In the Schema editor, we click on +Add next to Enumerations.
  2. We then type in a Display name, which is the name that we will see in the Schema.
  3. We also add an API ID, which we can use later to access the enumeration through the API Playground.
  4. Optionally, you can add a Description.
  5. Under enumeration values, you can add a list of values by manually entering the Display name, which autocompletes the API ID field, and then clicking + Add. Your values will display on a list below.
  6. Once you have added all the enumeration values, click Add Enumeration at the bottom of the screen to finish the process.

For this tutorial, we will add 4 enumerations: separate sizes for shoes and clothes, and separate colors for wearables and decor.

Use the following information to add them:

Clothes size

FieldInput
Display nameClothes size
API IDClothesSize
Enumeration valuesOne by one, add the following: XS, S, M, L, XL

Clothes size enumerationClothes size enumeration

Shoes size

FieldInput
Display nameShoes size
API IDShoesSize
Enumeration valuesOne by one, add the following: Size_35, Size_36, Size_37, Size_38, Size_39, Size_40, Size_41, Size_42, Size_43, Size_44

Shoes size enumerationShoes size enumeration

Wearable items color

FieldInput
Display nameWearable items color
API IDWearableItemsColor
Enumeration valuesOne by one, add the following: Red, Green, Blue, Black, White

Wearable items color enumerationWearable items color enumeration

Decor items color

FieldInput
Display nameDecor items color
API IDDecorColor
Enumeration valuesOne by one, add the following: Gold, Silver, Bronze, Cobalt

Decor items color enumerationDecor items color enumeration

After adding your Enumerations the left sidebar should look like this:

Your enumerations listed in the schemaYour enumerations listed in the schema