This lesson will cover API pagination using a limit and offset. The next will cover cursor paged pagination.
Here is the repo + branch for this material:
🔗 PENDING EMBED — review: Notion bookmark (repo + branch) —
Approach to Pagination
We will start by having the user provide a page URL parameter. Then, we will talk about how we can have them provide a limit and offset instead of us calculating those values manually. These are what are actually used to retrieve data from the database.
Our first approach is to calculate the count, and build out a response structure like so: