State Management · Junior · Question 46 of 75

How does an RTK Query mutation make lists refetch after adding an item?

Explanation

getPosts provides the Post tag and addPost invalidates it - active queries with that tag refetch automatically. It's the RTK Query counterpart of invalidateQueries in TanStack Query.

Further reading

Problem with a question

State Management · Junior · question 46

Test yourself

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

Take this quiz