@apollo/client 3.6.0-beta.1 → 3.6.0-beta.2

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
@@ -19,11 +19,11 @@ function _interopNamespace(e) {
19
19
  if (e && e.__esModule) return e;
20
20
  var n = Object.create(null);
21
21
  if (e) {
22
- Object.keys(e).forEach(function (k) {
22
+ for (var k in e) {
23
23
  n[k] = e[k];
24
- });
24
+ }
25
25
  }
26
- n['default'] = e;
26
+ n["default"] = e;
27
27
  return Object.freeze(n);
28
28
  }
29
29
 
@@ -1292,7 +1292,7 @@ var concat = ApolloLink.concat;
1292
1292
 
1293
1293
  var execute = ApolloLink.execute;
1294
1294
 
1295
- var version = '3.6.0-beta.1';
1295
+ var version = '3.6.0-beta.2';
1296
1296
 
1297
1297
  var hasOwnProperty$2 = Object.prototype.hasOwnProperty;
1298
1298
  function parseAndCheckHttpResponse(operations) {
@@ -6312,13 +6312,13 @@ function useMutation(mutation, options) {
6312
6312
  var mutationId = ++ref.current.mutationId;
6313
6313
  var clientOptions = mergeOptions(baseOptions, executeOptions);
6314
6314
  return client.mutate(clientOptions).then(function (response) {
6315
- var _a;
6315
+ var _a, _b;
6316
6316
  var data = response.data, errors = response.errors;
6317
6317
  var error = errors && errors.length > 0
6318
6318
  ? new ApolloError({ graphQLErrors: errors })
6319
6319
  : void 0;
6320
6320
  if (mutationId === ref.current.mutationId &&
6321
- !baseOptions.ignoreResults) {
6321
+ !clientOptions.ignoreResults) {
6322
6322
  var result_1 = {
6323
6323
  called: true,
6324
6324
  loading: false,
@@ -6331,8 +6331,10 @@ function useMutation(mutation, options) {
6331
6331
  }
6332
6332
  }
6333
6333
  (_a = baseOptions.onCompleted) === null || _a === void 0 ? void 0 : _a.call(baseOptions, response.data);
6334
+ (_b = executeOptions.onCompleted) === null || _b === void 0 ? void 0 : _b.call(executeOptions, response.data);
6334
6335
  return response;
6335
6336
  }).catch(function (error) {
6337
+ var _a, _b;
6336
6338
  if (mutationId === ref.current.mutationId &&
6337
6339
  ref.current.isMounted) {
6338
6340
  var result_2 = {
@@ -6346,8 +6348,9 @@ function useMutation(mutation, options) {
6346
6348
  setResult(ref.current.result = result_2);
6347
6349
  }
6348
6350
  }
6349
- if (baseOptions.onError) {
6350
- baseOptions.onError(error);
6351
+ if (baseOptions.onError || clientOptions.onError) {
6352
+ (_a = baseOptions.onError) === null || _a === void 0 ? void 0 : _a.call(baseOptions, error);
6353
+ (_b = executeOptions.onError) === null || _b === void 0 ? void 0 : _b.call(executeOptions, error);
6351
6354
  return { data: void 0, errors: error };
6352
6355
  }
6353
6356
  throw error;