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

[3.8 beta] useBackgroundQuery/useReadQuery compatibility with @apollo/experimental-nextjs-app-support #10875

Closed
alessbell opened this issue May 15, 2023 · 5 comments
Assignees
Milestone

Comments

@alessbell
Copy link
Member

Issue Description

See discussion: #10755 (comment)

Link to Reproduction

N/A

Reproduction Steps

No response

@alessbell
Copy link
Member Author

alessbell commented May 16, 2023

  • hide queryref in a Symbol that AC declares -> might rename existing QueryRef to InternalQueryRef
  • PR to experimental package

@alessbell
Copy link
Member Author

alessbell commented May 24, 2023

  • we can only flush data over to the client when a Suspense boundary finishes
  • for these two hooks, some scenarios where this could cause UI bugs:
    • conditionally rendering a Suspense boundary - the data would never be transported over (the data is in the array on the server but is never flushed)
    • timing issues: the client receives an update to some data in the query that's running on the server before the server data is flushed to the client. This could cause "old" data to overwrite "new" data.
  • server and client components should not have overlapping queries because the RSC render static HTML and will not update (unless you call router refresh - which is what Patrick does in his RSC example)
  • useBackgroundQuery would run once on the server and once on the client

@jerelmiller jerelmiller added this to the Release 3.8 milestone May 26, 2023
@jerelmiller jerelmiller changed the title [3.8 alpha] useBackgroundQuery/useReadQuery compatibility with @apollo/experimental-nextjs-app-support [3.8 beta] useBackgroundQuery/useReadQuery compatibility with @apollo/experimental-nextjs-app-support Jun 15, 2023
@alessbell
Copy link
Member Author

The majority of this work was completed in apollographql/apollo-client-nextjs#38 and released in v0.3.0 of @apollo/experimental-nextjs-app-support.

Leaving this issue open to track the remaining work needed in Apollo Client (hide queryRef) which I should be able to get to today :)

@alessbell
Copy link
Member Author

Closed via #11010.

@github-actions
Copy link
Contributor

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
For general questions, we recommend using StackOverflow or our discord server.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants