...

/

Exercise: Add Categories to the API

Exercise: Add Categories to the API

Practice implementing resolvers by implementing new GraphQL types and queries.

Let’s put our newly acquired skills to use! In this exercise, we’ll practice adding a new type and a new query to our API. This lesson will outline what we want to add and will provide us with a link to the starter project. There will also be step-by-step instructions for how to implement the solution.

Exercise source code

To get the source code for this exercise run the following command in the project’s repository:

git checkout categories-exercise

Practice demo

Let’s practice what we’ve learned so far in the provided playground.

{
  "ext": "js,graphql",
  "delay": 2000
}
Empty demo

What we’re implementing

In this exercise, we’re going to add support for product categories to our API. Each product might belong to one of a few categories, such as Education or API.

Every instance of the Category type will have the following three types: ...