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

Get hands-on with 1200+ tech skills courses.