Skip to content

In what states mutation can be? #1400

Answered by kitten
RIP21 asked this question in Q&A
Feb 19, 2021 · 1 comments · 3 replies
Discussion options

You must be logged in to vote

Hiya 👋

Mutations cannot carry a stale flag. The stale flag signfies that urql is expecting another result for a query. Hence this flag only currently applies to queries. The important point here is that it's implemented currently by both @urql/core and the cache exchanges. Whenever we know that a new network result will come in for queries we can set this flag.

This stands in contrast with mutations. Mutations are often "fire and forget" and can be executed multiple times, each resulting in a new independent result.

You can see this guarantee in action here too: https://github.com/FormidableLabs/urql/blob/e5ea77e836b11be379327bee7abe74109d0adabc/packages/core/src/client.ts#L244-L251

Basic…

Replies: 1 comment 3 replies

Comment options

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

@kitten
Comment options

@RIP21
Comment options

Answer selected by RIP21
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