Create a Schema for Categories
Explore how to create a category schema in Hygraph with fields like name, slug, and image, and understand linking categories to products via reference fields. This lesson helps you manage related content effectively for your e-commerce app.
We'll cover the following...
We'll cover the following...
Previously, we learned how to create a schema for our products (shoes). In this lesson, we are going to create a schema for our categories. The process is quite similar but has different fields.
Create a category model and add fields
Similar to how we created the model and added fields, we’ll do the same for the category model. The category model will have just three fields: name, slug, and ...