[experiment/idea] allow enabling "forced suspense" for useQuery hook in SSR#226
Draft
phryneas wants to merge 1 commit into
Draft
[experiment/idea] allow enabling "forced suspense" for useQuery hook in SSR#226phryneas wants to merge 1 commit into
phryneas wants to merge 1 commit into
Conversation
Job #116: Bundle Size — 1.01MiB (+0.65%).Warning Bundle contains 1 duplicate package – View duplicate packages Bundle metrics
Bundle size by type
View job #116 report View pr/useQuery_forcedSuspense branch activity View project dashboard |
phryneas
commented
Mar 6, 2024
| export const dynamic = "force-dynamic"; | ||
|
|
||
| export default function Page() { | ||
| enableSSRWaitForUseQuery(useApolloClient()); |
Member
Author
There was a problem hiding this comment.
This line should usually be called once per application as part of makeClient, but here I wanted to enable this behaviour just for that one page.
Member
Author
|
/release:pr |
Contributor
|
A new release has been made for this PR. You can install the package you need using one of
|
312f655 to
b1a2f84
Compare
Contributor
size-limit report 📦
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This came up in https://community.apollographql.com/t/streaming-without-suspense-in-apollo-nextjs-client/7259 - essentially, we could allow users to opt
useQueryinto suspending during SSR, souseQueryresult could also be streamed from SSR instead of just rendering a "loading" indicator in SSR.If we actually want to do this, it should probably be documented as a "you can do this while you are migrating to suspense" approach.