Updating mutation data from another mutation
Hi
I work on an app that heavily relies on outputs from LLMs, and as such we prefer using
The main reason we can't use
My problem is that different mutations might rely on the data from each other, so we keep a state variable and update it in the
Maybe we are approaching this all wrong, and if so I'd love to hear how we can do better!
Thank you!
I work on an app that heavily relies on outputs from LLMs, and as such we prefer using
useMutation to fetch text generations which are not stored in a database. The main reason we can't use
useQuery is that we can't allow requests to fire unintentionally. We tried using it, but had to turn off refetch and retry, set cacheTime and staleTime to 0 and set enable: false but there could still be a chance that a dependency is updated and another request is triggered which is bad for us. All the requests are triggered by user interactions. My problem is that different mutations might rely on the data from each other, so we keep a state variable and update it in the
onSuccess callback of the mutations. I was wondering if we can somehow update the mutation result directly and not have to store it ourselves. Maybe we are approaching this all wrong, and if so I'd love to hear how we can do better!
Thank you!