State Management · Senior · Question 74 of 75

What's wrong with providesTags: (result) => result.map(({ id }) => ({ type: "Post", id }))?

Explanation

Write result ? [...result.map(...), { type: "Post", id: "LIST" }] : [{ type: "Post", id: "LIST" }] so a later mutation can still trigger a refetch after an error.

Further reading

Problem with a question

State Management · Senior · question 74

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