Skip to content

Custom hook for mutation not working #5862

Discussion options

You must be logged in to vote

I think that if there are multiple arguments to the mutation function they must be supplied as an object.

mutationFn: (variables: TVariables) => Promise<TData>
and
mutate: (variables: TVariables, { onSuccess, onSettled, onError }) => void
from: https://tanstack.com/query/v4/docs/react/reference/useMutation

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@lagroms
Comment options

@TkDodo
Comment options

Answer selected by lagroms
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants