Build a pagination system
Add cursor-based pagination to any list endpoint with cursor and limit params, a nextCursor response, and a matching SQL query. Handles the first page gracefully.
Preview
Copy prompt
Implement cursor-based pagination for a [Language/Framework] API list endpoint returning [Resource]. Accept `cursor` and `limit` as query parameters, return a `nextCursor` in the response when more results exist, and handle the initial page with no cursor gracefully. Include the SQL or ORM query that powers the cursor lookup and document the full response shape including the data array and pagination metadata.
More
Code Generation
Prompts
