-
I have the following situation.
Am I missing something? :) Also, I'm unsure how keys resolvers are working for interfaces. If I implement keys calculation for the interface will it work on entities that implement this interface? Or I should implement I can elaborate on the example more if needed with the schema example I have :) BTW, any possibility to refetch not based on type, but rather on query name? It's usually useless and complicates things, but for |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
No, Graphcache is a normalised cache with the aim to reduce refetches and to share data where possible. (Although with a new addition in the populate exchange this may change in the future, in terms of a slow migration path and alternatives becoming available) But you do have several options:
There's more details on updaters on this docs page: https://formidable.com/open-source/urql/docs/graphcache/custom-updates/ Interfaces are just common descriptions of fields, hence — like enums — they have no effect on key generation. On a last part, we'd never offer refetching by query. That'd require us to keep track of all variables that have ever been sent with that queries and those queries themselves, since it makes a difference whether these queries are active or not. Generally no exchange in If we'd allow you to pass queries and variables like Apollo, you'd may as well call the client imperatively. This is also a pattern we don't want to encourage though since it introduces coupling between completely separate random queries. One page's mutation shouldn't have to know about all other queries and variables of a given app. That quickly gets out of hand; that's also why in Graphcache the config is centralised. The schema's structure is a better abstraction for caching and updates than queries. |
Beta Was this translation helpful? Give feedback.
No, Graphcache is a normalised cache with the aim to reduce refetches and to share data where possible. (Although with a new addition in the populate exchange this may change in the future, in terms of a slow migration path and alternatives becoming available) But you do have several options:
additionalTypenames
cache.invalidate
to remove the cached list and force Graphcache to refetch itThere's more details on updaters on this docs page: https://formidable.com/open-source/urql/docs/graphcac…