|
|
|
|
|
by true_religion
2582 days ago
|
|
You can’t invalidate the cache in Apollo. You have to clear all items, or update a specific part to a new value. It’s not a simple key value cache, but a graph of values, which makes invalidation more complex but still in my opinion that is a huge oversight. Hopefully an Apollo dev can give us some insight here: why is the cache a requirement? Why is it threaded into every bit of code? I’ve seen so many bugs from the cache, and I know there is a technical reason it has to be part of the core codebase, but I have forgotten why. |
|
For what it's worth, we are rearchitecting parts of the cache to support invalidation and garbage collection for Apollo Client 3.0. The only reason why we don't have it yet is because it's a tough problem to solve - one mutation could invalidate an infinite amount of queries. We're committed to solving this soon though because we know the community really wants it.