Skip to content

Optimistic mutation not working offline #1068

Answered by kitten
codazzo asked this question in Q&A
Discussion options

You must be logged in to vote

So that's expected behaviour (which I suppose we need to highlight more aggressively once we fill out our Offline docs page with more templates and details)

The optimistic mutations aren't guaranteed to resolve when you're in offline mode. Conceptually you can think of what Graphcache does with optimistic updates as a barrier: We never want optimistic updates to pollute real data. That means it's not persisted (and instead re-created on startup), the optimistic results are never written to the permanent (non-optimistic) data, queries will never destroy optimistic results (instead they're paused while optimistic mutations are in-flight), and lastly optimistic results are never returned to …

Replies: 2 comments 3 replies

Comment options

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

@waweru-kamau
Comment options

@codazzo
Comment options

Answer selected by codazzo
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants