-
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
The variables in the cache are not identical with SSR. #8855
Comments
@negezor This is surprising because Apollo Client and |
I tried to reproduce the error, but I can't reproduce the error. I also tried to install different versions, but the result was the same. I'm not using I am using Nuxt.js (Vue) and @vue/apollo-composable. There is a community module @nuxtjs/apollo, but it does not support Apollo 3. I manually configured Apollo, everything works except for a cache error in SSR. Can the hook library affect the cache result? |
@benjamn This might have to do with the way we serialize variables in our SSR stuff, though if the user is using Vue.js, I’m not sure how relevant that is (https://github.com/apollographql/apollo-client/blob/main/src/react/ssr/RenderPromises.ts#L105). |
@brainkim I serialize the cache like this JSON.stringify(cache.extract()); |
Somehow the linked PR didn't automatically close this so I'll do it manually :) let us know if you need more support here! |
Intended outcome:
The variables in the cache are identical to those retrieved using SSR.
Actual outcome:
The variables in cache are sorted in a different order. The apollo client does not find the cache and makes new requests. If you look at the ROOT_QUERY cache through the Apollo Client Devtools, there will be two different keys:
How to reproduce the issue:
Versions
@apollo/client
:3.4.15
graphql
:15.6.0
The text was updated successfully, but these errors were encountered: