Pagination With GraphQL
Learn how to implement pagination API with Apollo Server.
We'll cover the following...
We’ve already implemented a few queries that fetch multiple products from our backend. However, in all the previous cases, these queries returned all the objects available on the backend. This isn’t very practical!
As soon as our application gets any traction, it’ll collect thousands of products in its database. Fetching and returning thousands of objects on every request is hardly scalable, so if we plan to make our application usable, we need to update our API to return results in a piecemeal fashion.
This is called pagination and in this lesson, we’ll explore how to implement it on both the backend and the frontend of our application. We’ll implement a new query that allows us to get products from the server chunk by chunk. Then, we’ll update the frontend to use the new ...