When i switch from one tab to other my cache is not getting updated
function createApolloClient(headers) {
return new ApolloClient({
ssrMode: typeof window === "undefined", // set to true for SSR
link: createHttpLink({
uri,
credentials: "same-origin",
}),
cache: new InMemoryCache({
typePolicies: {
Query: {
fields: {
posts: relayStylePagination(["type"])
},
},
},
}),
});
}
It’s a little tough to figure out what’s going wrong just from this specific code example. I apologize! If you create a reproduction using GitHub - apollographql/react-apollo-error-template: Apollo Client issue reproduction. and ping me, I promise to take a look. SSR and relay-style pagination can be tricky to get working.