State Management · Senior · Question 33 of 75

How do you write the result of a mutation directly into a cached query without refetching (pessimistic update)?

Explanation

A pessimistic update waits for the server and then patches the cache - no extra request, but the UI updates only after the response. Optimistic updates patch first and undo on failure.

Further reading

Problem with a question

State Management · Senior · question 33

Test yourself

Take the State Management · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz