We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
onSuccess
queryClient
injectMutation
When the queryClient is passed in the injectMutation method, the return type of mutationFn is lost in the onSuccess method.
mutationFn
https://stackblitz.com/edit/stackblitz-starters-3zsk2e?file=test.ts
import { injectMutation } from "@tanstack/angular-query-experimental"; // without queryClient export const foo = injectMutation(() => ({ mutationFn: () => Promise.resolve({ foo: true }), onSuccess: (result) => { result.foo; // result: { foo: boolean; } } })); // with queryClient export const bar = injectMutation((queryClient) => ({ mutationFn: () => Promise.resolve({ bar: true }), onSuccess: (result) => { result.bar; // result: unknown } }));
Even if the queryClient is passed, the return type of the mutationFn should remain in the onSuccess method.
Every time
No response
angular-query
v5.55.4
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe the bug
When the
queryClient
is passed in theinjectMutation
method, the return type ofmutationFn
is lost in theonSuccess
method.Your minimal, reproducible example
https://stackblitz.com/edit/stackblitz-starters-3zsk2e?file=test.ts
Steps to reproduce
Expected behavior
Even if the
queryClient
is passed, the return type of themutationFn
should remain in theonSuccess
method.How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
Tanstack Query adapter
angular-query
TanStack Query version
v5.55.4
TypeScript version
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: