Versions
apollo-composable: 4.0.0-alpha.6
In useMutation.d.ts the return type of the function mutate is actually
Promise<FetchResult<any, Record<string, any>, Record<string, any>>>;
I should be fixed with TResult
Promise<FetchResult<TResult, Record<string, any>, Record<string, any>>>;
I get (with "@vue/apollo-composable": "^4.0.0-alpha.8"):
ERROR ERROR in /@app/server/node_modules/@vue/apollo-composable/dist/useMutation.d.ts(45,340):
45:340 Type 'MutateWithRequiredVariables<TResult, TVariables>' does not satisfy the constraint 'MutateWithOptionalVariables<TResult, TVariables>'.
Types of parameters 'variables' and 'variables' are incompatible.
Type 'TVariables | undefined' is not assignable to type 'TVariables'.
Type 'undefined' is not assignable to type 'TVariables'.
43 | * Use a mutation with variables, but without a default.
44 | */
> 45 | export declare function useMutation<TResult = any, TVariables extends OperationVariables = OperationVariables>(document: DocumentNode | ReactiveFunction<DocumentNode>, options?: UseMutationOptionsNoVariables<TResult, undefined> | ReactiveFunction<UseMutationOptionsNoVariables<TResult, undefined>>): UseMutationReturn<TResult, TVariables, MutateWithRequiredVariables<TResult, TVariables>>;
| ^
46 | export {};
47 |
Same issue with a clean install of `"@vue/apollo-composable": "^4.0.0-alpha.8". I see there's already a PR. It would be great if this could be merged.
Most helpful comment
I get (with "@vue/apollo-composable": "^4.0.0-alpha.8"):