-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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.3.0] Queries during SSR is always skipped. #7380
Comments
@yashok111 Can you show a small example of how you're changing |
Same problem here, when |
PR apollographql#7310 introduced a regression that caused skipped SSR queries to always set `loading` to `true`, which doesn't match the behavior of `useQuery()` on the client and can result in hydration mismatches. The problem is that `skip: true` was being treated as equivalent to `ssr: false`, but they're not actually equivalent. I think the correct solution is to let `this.getQueryResult()` provide a suitable result when `skip` is truthy, which ensures that skipped SSR queries will get the same result as skipped non-SSR queries. Fixes apollographql#7380
PR #7310 introduced a regression that caused skipped SSR queries to always set `loading` to `true`, which doesn't match the behavior of `useQuery()` on the client and can result in hydration mismatches. The problem is that `skip: true` was being treated as equivalent to `ssr: false`, but they're not actually equivalent. I think the correct solution is to let `this.getQueryResult()` provide a suitable result when `skip` is truthy, which ensures that skipped SSR queries will get the same result as skipped non-SSR queries. Fixes #7380 Co-authored-by: Ben Newman <ben@apollographql.com>
Intended outcome:
Queries should be completed during
renderToStringWithData
and return HTML with data.Actual outcome:
We have chained queries, that must wait data from another query. Looks like during rendering on server, all queries's skip option is always true, even if it changed. I have narrow this issue to
3.3.0-rc.3
, the #7310 was introduced in it, maybe this is causing the problem. On3.3.0-rc.2
everything work fine.How to reproduce the issue:
Sorry, but I don't have time to create repo(. Hope, description above is enough.
Versions:
System:
OS: macOS 10.15.7
Binaries:
Node: 14.13.1 - /usr/local/bin/node
Yarn: 1.22.10 - /usr/local/bin/yarn
npm: 6.14.8 - /usr/local/bin/npm
Browsers:
Chrome: 87.0.4280.67
Edge: 87.0.664.47
Firefox: 82.0.2
Safari: 14.0.1
npmPackages:
@apollo/client: 3.3.1 => 3.3.1
apollo-upload-client: 14.1.3 => 14.1.3
react-apollo-network-status: 5.0.1 => 5.0.1
The text was updated successfully, but these errors were encountered: