ponder-sh / ponder

A backend framework for crypto apps
https://ponder.sh
MIT License
585 stars 84 forks source link

[Feature] Offset pagination #901

Open 0xOlias opened 3 months ago

0xOlias commented 3 months ago

The findMany store method and the GraphQL API support cursor pagination as specified here.

A number of users have also requested offset pagination to support a "jump to page" feature, eg /?page=1. There are performance considerations here, but now that we have custom database indexes, perf issues can often be mitigated in userland.

hskang9 commented 2 months ago

I agree with this idea. Performance is a problem, but it is not the first problem when shipping an app. Offset is inefficient, but it is effective in making pagination UI components. I believe SQL API allows OFFSET keyword, and this is unfair for GraphQL api devs. I think keeping GraphQL out of offset is unfair and a premature optimization. How can I contribute to resolve this issue?