Skip to content

Selector for useMutation result before return #3059

Answered by TkDodo
zirkelc asked this question in Ideas
Discussion options

You must be logged in to vote

at the moment, you can just await the result in the mutateFn, and then transform it before you return it?

useMutation(async () => {
  const { data } = await axios.post(...)
  return transformData(data)
})

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@zirkelc
Comment options

@TkDodo
Comment options

@zirkelc
Comment options

@TkDodo
Comment options

Answer selected by zirkelc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
2 participants