...

/

Exercise: Implementing DataLoader

Exercise: Implementing DataLoader

Practice implementing the DataLoader library with Apollo Server.

In this exercise, we’ll implement a DataLoader to load objects from the users collection. Similar to how we did it in the previous lesson, we’ll have to add a new function to create a new DataLoader. Then, we’ll have to update our resolvers to use the new DataLoader instead of querying a database directly.

Exercise source code

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

git checkout data-loader-exercise

Practice demo

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

How to start a project

Before we start writing code, here’s a quick reminder on how to run the ...