Problem Statement
When does RTK Query refetch queries after a mutation with invalidatesTags?
Explanation
When a mutation succeeds and defines invalidatesTags, RTK Query automatically triggers refetches for all query endpoints that provide those tags, ensuring your cached data stays synchronized with the backend. This automatic invalidation happens immediately after the mutation completes successfully, and you can specify tags statically or compute them dynamically based on mutation arguments or results. This eliminates the need for manual refetch logic and makes data consistency much easier to maintain.
