Skip to content

Commit 7008d8a

Browse files
committed
fix: set client from $apollo correctly in mutateWithErrorHandling
1 parent 75679dc commit 7008d8a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/mutation.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,11 @@ export async function mutateWithErrorHandling<
9090
client?: ApolloMutationClient<TResult, TVariables>,
9191
): Promise<MutationResult<TResult>> {
9292
const mutate =
93-
client === undefined ? app.$apollo : typeof client === 'function' ? client : client.mutate.bind(client);
93+
client === undefined
94+
? app.$apollo.mutate.bind(app.$apollo)
95+
: typeof client === 'function'
96+
? client
97+
: client.mutate.bind(client);
9498

9599
try {
96100
const result = await mutate({

0 commit comments

Comments
 (0)