T
TanStack•3y ago
fascinating-indigo

When mutation should end up with success?

Im returning undefined from mutationFn and there is still success, also fetch response of 404 status for example does not end up with error, always is success.
3 Replies
initial-rose
initial-rose•3y ago
Query Functions | TanStack Query Docs
A query function can be literally any function that returns a promise. The promise that is returned should either resolve the data or throw an error. All of the following are valid query function configurations:
fascinating-indigo
fascinating-indigoOP•3y ago
Ah, thanks. So basically I should throw Error in mutation - then its is logged as Error, but not uncaught. However in svelte version when throwing error inside mutation fn i see uncaught Error, whereas in react there is no "uncaught". Its bug or something?
No description
fascinating-indigo
fascinating-indigoOP•3y ago
@TkDodo 🔮 @Raytuzio maybe You can help

Did you find this page helpful?