State Management · Middle · Question 28 of 75

How do you refresh the list after useMutation creates an item?

Explanation

Invalidation marks matching queries stale and refetches active ones. Alternatively write the returned object into the cache with setQueryData. Hooks can't be called inside callbacks.

Further reading

Problem with a question

State Management · Middle · question 28

Test yourself

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

Take this quiz