Skip to content

Why does my query operation get upgraded to "cache-first", despite explicitly setting it to "cache-only"? #1480

Answered by JoviDeCroock
IsaacAderogba asked this question in Q&A
Discussion options

You must be logged in to vote

Hey,

The mutation causes the default document-based cache to invalidate the entity, this isn't on a query-level, it will just refetch the query if it's being watched as this mutation could have invalidated this entity.
It sees your mutation returning something of __typename Feedback and it sees that getFeedback observers entities with __typename Feedback this means that this naive cache has no other option then to refetch this entity as it could be stale.

More about this here

If you really want to stay on the client and do something locally with the response of your mutation we'll find ourselves in a normalized caching world.

More about this here

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@IsaacAderogba
Comment options

@JoviDeCroock
Comment options

@IsaacAderogba
Comment options

Answer selected by IsaacAderogba
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants