Skip to content

Commit

Permalink
(fix) - ensure useMutation executes with an empty object as context t…
Browse files Browse the repository at this point in the history
…o prevent potential crashes
  • Loading branch information
JoviDeCroock committed Aug 20, 2019
1 parent d690ccb commit 220cd40
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/hooks/useMutation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const useMutation = <T = any, V = object>(
const request = createRequest(query, variables as any);

return pipe(
client.executeMutation(request, context),
client.executeMutation(request, context || {}),
toPromise
).then(result => {
const { data, error, extensions } = result;
Expand Down

0 comments on commit 220cd40

Please sign in to comment.