Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Server-Side Pagination in Next.js with Apollo Client #11765

Closed
berzhavycha opened this issue Apr 6, 2024 · 2 comments
Closed

Implement Server-Side Pagination in Next.js with Apollo Client #11765

berzhavycha opened this issue Apr 6, 2024 · 2 comments
Labels
🏓 awaiting-contributor-response requires input from a contributor

Comments

@berzhavycha
Copy link

Is it feasible to enable server-side pagination exclusively in Next.js using Apollo Client? Apollo Client provides @apollo/experimental-nextjs-app-support for Next.js app client management. However, a question arises: Can pagination be solely implemented on the server side? My understanding suggests it may not be viable because each request from the server component generates a new client instance, hindering the merging of items for pagination. Does this limitation imply that pagination can only be achieved through client-side data fetching? Alternatively, are there potential workarounds to address this issue?

@phryneas
Copy link
Member

phryneas commented Apr 8, 2024

It depends solely on what you mean by "pagination".

In the classic meaning of "displaying one page only", yes, that can be achieved with Next.js RSC, as you don't need to merge with previous data for that.
If you mean "infinite scrolling": As far as I'm aware there's no way of doing that with RSC at all, independently of Apollo Client.

@jerelmiller jerelmiller added the 🏓 awaiting-contributor-response requires input from a contributor label Apr 15, 2024
Copy link
Contributor

We're closing this issue now but feel free to ping the maintainers or open a new issue if you still need support. Thank you!

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏓 awaiting-contributor-response requires input from a contributor
Projects
None yet
Development

No branches or pull requests

3 participants