State Management · Middle · Question 29 of 75

Which queries does invalidateQueries({ queryKey: ['todos'] }) match?

Explanation

Prefix matching makes hierarchical keys useful: ['todos'] → ['todos', 'list', filters] → ['todos', 'detail', id]. Use exact: true for an exact match.

Further reading

Problem with a question

State Management · Middle · question 29

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