C
C#12mo ago
Core

2 way cursor pagination design

Hi! If you were to implement a two-way cursor pagination with next_cursor and prev_cursor for an API endpoint, how would you handle the case when both cursors were provided in the request? 1. Error message 2. Prioritize one of the 2 cursors
4 Replies
jcotton42
jcotton4212mo ago
do you need to use database cursors?
Core
CoreOP12mo ago
Yes, it is already implemented with EF. It's just a generic question and I cannot decide which approach is more convenient if the API is public, used by developers
jcotton42
jcotton4212mo ago
well, it sounds like having both cursors is incorrect so you'd want to return HTTP 400 plus an error message
Core
CoreOP12mo ago
Alright, thank you!
Want results from more Discord servers?
Add your server