-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Closed
Description
Discussed in #2911
Originally posted by phatmann November 11, 2021
Calling QueryClient.setQueryData
method triggers the onSuccess
callback. For many users, including me, this is unexpected behavior, and can be the source of recursion issues, since the onSuccess
handler might make calls to setQueryData
.
I propose we create a new onDataChanged
callback. This would be trigged when cache data is changed via setQueryData
or via a fetch. The onSuccess
callback would only be called after a successful fetch.
For completeness, the same onDataChanged
callback would be added to QueryCache.