Cache.evict and useQuery (SSR)


In my project I am using cache.evict to force queries to re-execute in my components.
An issue that I am seeing is on initial refresh/mount, SSR queries don’t seem to be re-executed when cache.evict is called.

Is there a way around this?

In my scenario I have the same query executed in 2 components on the same page, one is loaded on the client side and another is pre-loaded using SSR.

The pre-loaded one never updates unless I navigate away and back to my page (so its executed on the client).

I am using @apollo/client@3.4.5.

Any help is appreciated.

I just noticed that I had an issue with my login/logout code, when I call resetStore it would no longer re-execute my queries in order to refresh my page to show that I am logged-in or not.

So I tried the following, I uninstalled @apollo/client and reinstalled the oldest version I had before the recent updates, which was 3.3.21 and now my login/logout and even the useQuery code works again.

So something or some code changed and broke these functionalities in my app, not sure what though.

I will try to update version by version to see in what update it broke.


It seems to work up until 3.4.2, when I update to 3.4.3+ it no longer works at all.
So something definitely changed in the code due to the update.