-
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
Unexpected behavior in writing to InMemoryCache during SSR #6747
Comments
What version of |
Apologies for getting back late on this. If it is supposed to be |
@SiddharthMantri In theory, using const { data: bookData, loading, error } = useQuery(GET_BOOKS, {
fetchPolicy: "cache-and-network",
}); |
You are right about the superseded data - since that is exactly what we get back in the results. The cached data is overwritten. I assume there is no way to prevent the overwrite during SSR? We have (what we think is) a valid use case where the same data type needs to come from different sources, once before SSR by writing to cache using an internal API, and once on SSR where the query is resolved against another graphql service. The final values displayed should appear as if they were from a single source where the end user doesn't care about the underlying source. |
@SiddharthMantri Sorry for the very late follow-up, but this PR may be relevant to this issue: #7983 |
Let us know if this is still a concern with |
Issue submitted in collaboration with: @chrisbmar
Using Apollo v3. These are the steps that i have been able to identify in reproducing this bug:
item
to cache during SSR that already has typeDefs on the serverMinimum working example that runs in express:
On express
The text was updated successfully, but these errors were encountered: