TanStackT
TanStack3y ago
2 replies
dual-salmon

Pass information from onMutate to mutationFn

Is it possible to access the data returned by the onMutate function inside of the mutationFn function?

Context: I am using the onMutate function to do optimistic updates. While doing so, I append a little information to my object, which I would like to use when syncing with the server inside of the mutationFn function.
Was this page helpful?