Best Practice for mutationFn Return Value When Not Using Axios
mutationFn: (variables: TVariables) => Promise<TData>My main question is: Should I return the promise directly (e.g., return response.json()) or should I await response.json() first and then return the final data inside mutationFn?
I'm asking this question because I’ve noticed that examples on the internet differ on how they return data in a mutationFn. What are the practical and logical differences between these approaches? Are there any implications for error handling or the way React Query processes the mutation results?
Thanks in advance for any insights!