-
I have a situation where my mutation needs to involve some data from a useQuery. I could think of chaining the "mutate" in the "onSuccess" callback of useQuery, but this already sounds like an ongoing callback hell. Is there a better way to handle such chaining/dependent situations? Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
I don’t quite follow. Do you have an example maybe? |
Beta Was this translation helpful? Give feedback.
-
as discussed on Discord,
|
Beta Was this translation helpful? Give feedback.
as discussed on Discord,
queryClient.fetchQuery
is what you'd want. It will resolve the promise to data from the cache, and re-fetch if it's stale: