Open joehannouch opened 9 months ago
Apparently, it's an error with TenStack Query 5, everything works fine with V4. Will there ever be a V5 support update?
Thanks!
Oh, I missed v5 release! Thanks for mentioning that. I'll work on it coming week
version 15.10.1 should have support for Tanstack Query v5
I also experience the same issue even though I updated to the latest (15.10.1) version. There are no issues with @tanstack/react-query v4 though.
calling mutations from example app works for me now. Do you still experience the issue? Could you share your OpenAPI definition?
I am using these packages
"@tanstack/react-query": "5.8.4",
"@tanstack/react-query-devtools": "5.8.4",
"@tanstack/react-query-persist-client": "5.8.4",
"react-query-swagger": "15.10.3",
and the error I see when trying to run the TypeScript compiler (tsc
) is the following
Property 'isLoading' does not exist on type 'UseMutationResult<unknown, Error, void, unknown>'
I am using it like this:
const { isLoading: isLoadingStart, mutate: handleStart } = useMutation(() =>
someFn({
arg1,
arg2: {
arg3: ''
}
})
);
what is the version excatly?
what is the version excatly?
If this is related to my post above, I’ve already posted the versions 😄
Yep, still have the same issue. Latest V5.
I have similar issue, I solved it using new sintax on V5, need to pass an Object for options. Try something like:
useMutation({ mutationFn: your_function_here })
I have similar issue, I solved it using new sintax on V5, need to pass an Object for options. Try something like:
useMutation({ mutationFn: your_function_here })
yeah this worked for me, thanks
you need to have something like this:
const { mutate } = useMutation({ mutationFn: your_functionName, onSuccess: () => {}, });
Note the use of mutationFn
Apparently, it's an error with TenStack Query 5, everything works fine with V4. Will there ever be a V5 support update?
Thanks!
close the the issue if its solved and mark the answer
I too had the same issue in v5 Did resolve this by keeping it as : const { mutate } = useMutation({ mutationFn: your_functionName, onSuccess: () => {}, });
I've successfully integrated all my Get calls and got to the Post mutations now. I'm using NextJs 13.3.2 As soon as I make a call to the mutation I get an Unhandled Runtime Error
Unhandled Runtime Error TypeError: this[#client].defaultMutationOptions is not a function
A brief example of my mutation call: const addContentMutation = useContentControllerCreateContentMutation();
Help is appreciated