Invalidating query cache entries key Sex chat mature latin

Posted by / 14-Apr-2017 17:02

The idea behind a field-based invalidation system is to make this mutation code aware of the structure of the store, but absent of other code performing queries on that same store.

I would like to make all Observable Queries understand that some of their data is now invalid, but I don't see how when only having a path in the store - nothing really related to the queries used to build the observables.

Basically, I'm fighting the current design when trying to walk ahead on this approach. By the way: I guess being informed that @lucasconstantino I think I have similar use case.

Well, as far as I could look it up, cannot on it's own fix the stale data problem, meaning I would have to pull-request Apollo Client at least on some minor routines. I want to invalidate some queries after mutation and it doesn't matter are they active or stale.

I'm not sure how much this really adds to the conversation, but I spent a whole lot of time typing this out in a dupe issue, so I may as well add it here.

In the current state of things, it will work as expected for new queries the user eventually perform on that removed data, but if there are any active observable queries (queries currently watching for updates) related to the removed data, these queries will not refetch, but serve the same old data they had prior to the cache clearing.

To solve this problem, I'm working on a pull-request to to allow the user decide when new data should be refetched in case something goes stale: #1461.

:) Here is a use case my team commonly runs into that is not well covered by the existing cache control methods and would greatly benefit from field-based cache invalidation: Let's say I have a paginated list field in my schema: ), so there are an essentially unbounded number of possible permutations for this query.

Let's also say for the sake of argument that the sorting logic of this field is complex and cannot be simulated client-side.

invalidating query cache entries key-56invalidating query cache entries key-21invalidating query cache entries key-50

However, I don't want to force an immediate refetch because it may be a while before I actually need the results of the query.

One thought on “invalidating query cache entries key”