@@ -47,7 +47,6 @@ export declare namespace useMutation {
4747 export interface Options <
4848 TData = unknown ,
4949 TVariables extends OperationVariables = OperationVariables ,
50- TCache extends ApolloCache = ApolloCache ,
5150 > {
5251 /**
5352 * By providing either an object or a callback function that, when invoked after
@@ -58,7 +57,7 @@ export declare namespace useMutation {
5857 *
5958 * @group 1. Operation options
6059 */
61- optimisticResponse ?: ApolloClient . MutateOptions < TData , TVariables , TCache > [ 'optimisticResponse' ]
60+ optimisticResponse ?: ApolloClient . MutateOptions < TData , TVariables > [ 'optimisticResponse' ]
6261
6362 /**
6463 * A `MutationQueryReducersMap`, which is map from query names to
@@ -68,7 +67,7 @@ export declare namespace useMutation {
6867 *
6968 * @group 3. Caching options
7069 */
71- updateQueries ?: ApolloClient . MutateOptions < TData , TVariables , TCache > [ 'updateQueries' ]
70+ updateQueries ?: ApolloClient . MutateOptions < TData , TVariables > [ 'updateQueries' ]
7271
7372 /**
7473 * An array (or a function that _returns_ an array) that specifies which queries
@@ -82,7 +81,7 @@ export declare namespace useMutation {
8281 *
8382 * @group 3. Caching options
8483 */
85- refetchQueries ?: ApolloClient . MutateOptions < TData , TVariables , TCache > [ 'refetchQueries' ]
84+ refetchQueries ?: ApolloClient . MutateOptions < TData , TVariables > [ 'refetchQueries' ]
8685
8786 /**
8887 * If `true`, makes sure all queries included in `refetchQueries` are completed
@@ -91,14 +90,14 @@ export declare namespace useMutation {
9190 * @default false
9291 * @group 3. Caching options
9392 */
94- awaitRefetchQueries ?: ApolloClient . MutateOptions < TData , TVariables , TCache > [ 'awaitRefetchQueries' ]
93+ awaitRefetchQueries ?: ApolloClient . MutateOptions < TData , TVariables > [ 'awaitRefetchQueries' ]
9594
9695 /**
9796 * A function used to update the Apollo Client cache after the mutation completes.
9897 *
9998 * @group 3. Caching options
10099 */
101- update ?: ApolloClient . MutateOptions < TData , TVariables , TCache > [ 'update' ]
100+ update ?: ApolloClient . MutateOptions < TData , TVariables > [ 'update' ]
102101
103102 /**
104103 * Optional callback for intercepting queries whose cache data has been updated
@@ -111,7 +110,7 @@ export declare namespace useMutation {
111110 *
112111 * @group 3. Caching options
113112 */
114- onQueryUpdated ?: ApolloClient . MutateOptions < TData , TVariables , TCache > [ 'onQueryUpdated' ]
113+ onQueryUpdated ?: ApolloClient . MutateOptions < TData , TVariables > [ 'onQueryUpdated' ]
115114
116115 /**
117116 * Specifies how the mutation handles a response that returns both GraphQL errors
@@ -158,7 +157,7 @@ export declare namespace useMutation {
158157 *
159158 * @group 3. Caching options
160159 */
161- keepRootFields ?: ApolloClient . MutateOptions < TData , TVariables , TCache > [ 'keepRootFields' ]
160+ keepRootFields ?: ApolloClient . MutateOptions < TData , TVariables > [ 'keepRootFields' ]
162161
163162 /**
164163 * ID of a named Apollo client to use instead of the default.
@@ -186,7 +185,6 @@ export declare namespace useMutation {
186185 export interface Result <
187186 TData = unknown ,
188187 TVariables extends OperationVariables = OperationVariables ,
189- TCache extends ApolloCache = ApolloCache ,
190188 > {
191189 /**
192190 * Call the mutation with optional variables and override options.
@@ -212,7 +210,7 @@ export declare namespace useMutation {
212210 *
213211 * @group 1. Mutation
214212 */
215- mutate : _self . MutateFunction < TData , TVariables , TCache >
213+ mutate : _self . MutateFunction < TData , TVariables >
216214
217215 /**
218216 * The data returned from your mutation. Can be `undefined` if `errorPolicy`
@@ -279,23 +277,21 @@ export declare namespace useMutation {
279277 *
280278 * @group 6. Refs
281279 */
282- options : Readonly < Ref < _self . Options < TData , TVariables , TCache > | undefined > >
280+ options : Readonly < Ref < _self . Options < TData , TVariables > | undefined > >
283281 }
284282 }
285283
286284 /** Options for useMutation. */
287285 export type Options <
288286 TData = unknown ,
289287 TVariables extends OperationVariables = OperationVariables ,
290- TCache extends ApolloCache = ApolloCache ,
291- > = Base . Options < TData , TVariables , TCache >
288+ > = Base . Options < TData , TVariables >
292289
293290 /** Options when calling the mutate function. */
294291 export type MutateOptions <
295292 TData = unknown ,
296293 TVariables extends OperationVariables = OperationVariables ,
297- TCache extends ApolloCache = ApolloCache ,
298- > = Omit < Options < TData , TVariables , TCache > , 'clientId' | 'throws' | 'variables' > & {
294+ > = Omit < Options < TData , TVariables > , 'clientId' | 'throws' | 'variables' > & {
299295 /**
300296 * Variables for this mutation call. Not reactive - pass plain values.
301297 *
@@ -316,17 +312,13 @@ export declare namespace useMutation {
316312 export type MutateFunction <
317313 TData = unknown ,
318314 TVariables extends OperationVariables = OperationVariables ,
319- TCache extends ApolloCache = ApolloCache ,
320- > = { } extends TVariables
321- ? ( options ?: MutateOptions < TData , TVariables , TCache > ) => Promise < ApolloClient . MutateResult < MaybeMasked < TData > > >
322- : ( options : MutateOptions < TData , TVariables , TCache > & { variables : TVariables } ) => Promise < ApolloClient . MutateResult < MaybeMasked < TData > > >
315+ > = ( options ?: MutateOptions < TData , TVariables > & { variables ?: TVariables } ) => Promise < ApolloClient . MutateResult < MaybeMasked < TData > > >
323316
324317 /** {@inheritDoc @vue/apollo-composable!useMutation.Base.Result:interface } */
325318 export interface Result <
326319 TData = unknown ,
327320 TVariables extends OperationVariables = OperationVariables ,
328- TCache extends ApolloCache = ApolloCache ,
329- > extends Base . Result < TData , TVariables , TCache > { }
321+ > extends Base . Result < TData , TVariables > { }
330322
331323 export namespace DocumentationTypes {
332324 /** @group Composables Namespaces */
@@ -494,16 +486,15 @@ export declare namespace useMutation {
494486export function useMutation <
495487 TData = unknown ,
496488 TVariables extends OperationVariables = OperationVariables ,
497- TCache extends ApolloCache = ApolloCache ,
498489> (
499490 mutation : MaybeRefOrGetter < DocumentNode | TypedDocumentNode < TData , TVariables > > ,
500- options ?: MaybeRefOrGetter < useMutation . Options < TData , TVariables , TCache > > ,
501- ) : useMutation . Result < TData , TVariables , TCache > {
491+ options ?: MaybeRefOrGetter < useMutation . Options < TData , TVariables > > ,
492+ ) : useMutation . Result < TData , TVariables > {
502493 const currentScope = getCurrentScope ( )
503494
504495 // #region Input Normalization
505496 const document = toRef ( mutation )
506- const hookOptions = toRef ( options ) as Ref < useMutation . Options < TData , TVariables , TCache > | undefined >
497+ const hookOptions = toRef ( options ) as Ref < useMutation . Options < TData , TVariables > | undefined >
507498 // #endregion
508499
509500 // #region Apollo Client
@@ -574,7 +565,7 @@ export function useMutation<
574565
575566 // #region Mutate Function
576567 async function mutate (
577- executeOptions ?: useMutation . MutateOptions < TData , TVariables , TCache > ,
568+ executeOptions ?: useMutation . MutateOptions < TData , TVariables > ,
578569 ) : Promise < ApolloClient . MutateResult < MaybeMasked < TData > > > {
579570 const client = getClient ( )
580571 const currentMutationId = ++ mutationId
@@ -586,7 +577,7 @@ export function useMutation<
586577 const { clientId : _clientId , throws : _throws , variables : _hookVars , ...apolloHookOptions } = currentHookOptions
587578
588579 // Build merged options for Apollo
589- const mergedOptions : ApolloClient . MutateOptions < TData , TVariables , TCache > = {
580+ const mergedOptions : ApolloClient . MutateOptions < TData , TVariables > = {
590581 mutation : document . value ,
591582 ...apolloHookOptions ,
592583 ...executeOptions ,
@@ -601,15 +592,15 @@ export function useMutation<
601592 context : typeof executeOptions ?. context === 'function'
602593 ? executeOptions . context ( currentHookOptions . context )
603594 : ( executeOptions ?. context ?? currentHookOptions . context ) ,
604- } as ApolloClient . MutateOptions < TData , TVariables , TCache >
595+ } as ApolloClient . MutateOptions < TData , TVariables >
605596
606597 // Reset error and set loading
607598 error . value = undefined
608599 loading . value = true
609600 called . value = true
610601
611602 try {
612- const mutationResult = await client . mutate < TData , TVariables , TCache > ( mergedOptions )
603+ const mutationResult = await client . mutate < TData , TVariables > ( mergedOptions )
613604
614605 // Ignore stale results from previous mutations
615606 if ( currentMutationId !== mutationId ) {
@@ -679,7 +670,7 @@ export function useMutation<
679670
680671 // #region Public API
681672 return {
682- mutate : mutate as useMutation . MutateFunction < TData , TVariables , TCache > ,
673+ mutate : mutate as useMutation . MutateFunction < TData , TVariables > ,
683674 result,
684675 error,
685676 loading,
0 commit comments