I thought that my problem can be solved super quickly, yet I had to acknowledge that it’s much more complicated (or just I haven’t figured it out yet).
I have a query (
getExpensiveCalculation), which I fetch from the server for the very first time, and then I use the cached version of it to serve. Still, there are some operations that require refetching it, so after those I want to invalidate the cached version of it. Basically doing something like
refetchQueries, but without immediately refetching, only if it’s requested.
The best I could do was to retrieve the associated objects and evict those, but that doesn’t solve my problem. I would want to remove the entire query from the cache, as if it had never been fetched. What’s the best way to tackle this? What did I overlook?
EDIT: I basically want to call cache.reset(), but I only want to remove one particular query (
getExpensiveCalculation), and not everything.