TanStack / query

🤖 Powerful asynchronous state management, server-state utilities and data fetching for the web. TS/JS, React Query, Solid Query, Svelte Query and Vue Query.
https://tanstack.com/query
MIT License
40.09k stars 2.69k forks source link

isLoading does not exist on useMutation @tanstack/vue-query #7331

Closed benlutz closed 3 weeks ago

benlutz commented 3 weeks ago

Describe the bug

the isLoading property is missing on the useMutation Result

Property 'isLoading' does not exist on type 'UseMutationReturnType<Response, Error, void, unknown, MutationResult<Response, Error, void, unknown>>'.ts(2339)

Your minimal, reproducible example

https://codesandbox.io/p/devbox/silent-dream-wcczzk?file=%2Fsrc%2FApp.vue

Steps to reproduce

  1. Follow the docs, by using this code snipped:
    const { isLoading, isError, error, isSuccess, mutate } = useMutation({
    mutationFn: (newTodo) => axios.post('/todos', newTodo),
    })
  2. Try to use isLoading.

Expected behavior

I expect isLoading to be either true or false.

How often does this bug happen?

Every time

Screenshots or Videos

No response

Platform

Tanstack Query adapter

vue-query

TanStack Query version

5.31.0

TypeScript version

5.4.5

Additional context

it seems like also status is missing loading