query icon indicating copy to clipboard operation
query copied to clipboard

Docs: useMutation's returned `data` property description

Open swingthrough opened this issue 1 year ago • 2 comments

Describe the bug

I am reading the docs for useMutation and one of the returned properties is data. useMutation docs

This is the description:

  • data: undefined | unknown
    • Defaults to undefined
    • The last successfully resolved data for the query.

The last part mentions a query - what query would that be?

If it's a typo, what does the data property actually contain?

Your minimal, reproducible example

https://tanstack.com/query/latest/docs/framework/react/reference/useMutation#:~:text=data%3A%20undefined%20%7C%20unknown

Steps to reproduce

Read the docs for data returned by useMutation

Expected behavior

Better description of what the property means

How often does this bug happen?

None

Screenshots or Videos

No response

Platform

--

Tanstack Query adapter

None

TanStack Query version

v.5

TypeScript version

No response

Additional context

No response

swingthrough avatar Feb 03 '24 14:02 swingthrough

I tried it and the data property basically contains the resolved value that mutationFn returns. So would the correct phrasing be "The last successfully resolved data from the mutationFn"?

swingthrough avatar Feb 04 '24 09:02 swingthrough

it's a typo.The last successfully resolved data for the mutation. Please make a PR to the docs.

TkDodo avatar Feb 13 '24 14:02 TkDodo