@apollo/client 3.5.3 → 3.5.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/apollo-client.cjs CHANGED
@@ -1291,7 +1291,7 @@ var concat = ApolloLink.concat;
1291
1291
 
1292
1292
  var execute = ApolloLink.execute;
1293
1293
 
1294
- var version = '3.5.3';
1294
+ var version = '3.5.4';
1295
1295
 
1296
1296
  var hasOwnProperty$2 = Object.prototype.hasOwnProperty;
1297
1297
  function parseAndCheckHttpResponse(operations) {
@@ -6353,13 +6353,13 @@ function useMutation(mutation, options) {
6353
6353
  var mutationId = ++ref.current.mutationId;
6354
6354
  var clientOptions = mergeOptions(baseOptions, executeOptions);
6355
6355
  return client.mutate(clientOptions).then(function (response) {
6356
- var _a;
6356
+ var _a, _b;
6357
6357
  var data = response.data, errors = response.errors;
6358
6358
  var error = errors && errors.length > 0
6359
6359
  ? new ApolloError({ graphQLErrors: errors })
6360
6360
  : void 0;
6361
6361
  if (mutationId === ref.current.mutationId &&
6362
- !baseOptions.ignoreResults) {
6362
+ !clientOptions.ignoreResults) {
6363
6363
  var result_1 = {
6364
6364
  called: true,
6365
6365
  loading: false,
@@ -6372,8 +6372,10 @@ function useMutation(mutation, options) {
6372
6372
  }
6373
6373
  }
6374
6374
  (_a = baseOptions.onCompleted) === null || _a === void 0 ? void 0 : _a.call(baseOptions, response.data);
6375
+ (_b = executeOptions.onCompleted) === null || _b === void 0 ? void 0 : _b.call(executeOptions, response.data);
6375
6376
  return response;
6376
6377
  }).catch(function (error) {
6378
+ var _a, _b;
6377
6379
  if (mutationId === ref.current.mutationId &&
6378
6380
  ref.current.isMounted) {
6379
6381
  var result_2 = {
@@ -6387,8 +6389,9 @@ function useMutation(mutation, options) {
6387
6389
  setResult(ref.current.result = result_2);
6388
6390
  }
6389
6391
  }
6390
- if (baseOptions.onError) {
6391
- baseOptions.onError(error);
6392
+ if (baseOptions.onError || clientOptions.onError) {
6393
+ (_a = baseOptions.onError) === null || _a === void 0 ? void 0 : _a.call(baseOptions, error);
6394
+ (_b = executeOptions.onError) === null || _b === void 0 ? void 0 : _b.call(executeOptions, error);
6392
6395
  return { data: void 0, errors: error };
6393
6396
  }
6394
6397
  throw error;