Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
GraphQL Cursor Connections Specification (relay.dev)
3 points by nonethewiser on May 17, 2023 | hide | past | favorite | 2 comments


"Cursor-based pagination is the most efficient method of paging and should always be used when possible."

https://developers.facebook.com/docs/graph-api/results

This is a nice spec for implementing cursor based pagination in GQL. My interest was piqued because I had heard of cursor based pagination but only had experience with limit/offset. I suspect maybe that is the case for others. I also just find the specification very clear and well done which makes it beautiful in a weird sort of way.


I guess the question becomes, how do you actually implement this using something like postgres on the backend? You actually need to keep a transaction open to perhaps guarantee the results in the cursor are consistent with the results from the previous page?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: