Skip to content
New issue

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

useMutation type error #190

Open
yveeven opened this issue Jan 8, 2025 · 0 comments
Open

useMutation type error #190

yveeven opened this issue Jan 8, 2025 · 0 comments

Comments

@yveeven
Copy link

yveeven commented Jan 8, 2025

useMutation: <TQueryFnData extends TDef['output'] = TDef['output'], TData = TQueryFnData, PickKeys extends KeysOf<TData> = KeysOf<TData>>(opts?: Omit<AsyncDataOptions<TQueryFnData, TData, PickKeys>, 'lazy' | 'watch'>) => AsyncData<PickFrom<TData, PickKeys> | null, TRPCClientErrorLike<TDef>> & {
        /**
         * The function to call to trigger the mutation.
         */
        mutate: (input: TDef['output']) => Promise<UnwrapRef<AsyncData<PickFrom<TData, PickKeys> | null, TRPCClientErrorLike<TDef>>['data']>>;
        trpc?: TRPCRequestOptions;
    };

I think TDef['output'] here should be TDef['input'] instead.
isn't it input when mutate is used?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant