@apollo/client 3.11.3 → 3.11.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/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @apollo/client
2
2
 
3
+ ## 3.11.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [#11994](https://github.com/apollographql/apollo-client/pull/11994) [`41b17e5`](https://github.com/apollographql/apollo-client/commit/41b17e5950f4db5ef9e32ded5bb327b3bf19e6e8) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Update the `Modifier` function type to allow `cache.modify` to return deeply partial data.
8
+
9
+ - [#11989](https://github.com/apollographql/apollo-client/pull/11989) [`e609156`](https://github.com/apollographql/apollo-client/commit/e609156c4989def88ae1a28b2e0f0378077a5528) Thanks [@phryneas](https://github.com/phryneas)! - Fix a potential crash when calling `clearStore` while a query was running.
10
+
11
+ Previously, calling `client.clearStore()` while a query was running had one of these results:
12
+
13
+ - `useQuery` would stay in a `loading: true` state.
14
+ - `useLazyQuery` would stay in a `loading: true` state, but also crash with a `"Cannot read property 'data' of undefined"` error.
15
+
16
+ Now, in both cases, the hook will enter an error state with a `networkError`, and the promise returned by the `useLazyQuery` `execute` function will return a result in an error state.
17
+
18
+ - [#11994](https://github.com/apollographql/apollo-client/pull/11994) [`41b17e5`](https://github.com/apollographql/apollo-client/commit/41b17e5950f4db5ef9e32ded5bb327b3bf19e6e8) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Prevent accidental distribution on `cache.modify` field modifiers when a field is a union type array.
19
+
3
20
  ## 3.11.3
4
21
 
5
22
  ### Patch Changes
package/apollo-client.cjs CHANGED
@@ -31,7 +31,7 @@ function _interopNamespace(e) {
31
31
  var equal__default = /*#__PURE__*/_interopDefaultLegacy(equal);
32
32
  var React__namespace = /*#__PURE__*/_interopNamespace(React);
33
33
 
34
- var version = "3.11.3";
34
+ var version = "3.11.4";
35
35
 
36
36
  function maybe(thunk) {
37
37
  try {
@@ -1396,7 +1396,7 @@ var Concast = (function (_super) {
1396
1396
  _this.cancel = function (reason) {
1397
1397
  _this.reject(reason);
1398
1398
  _this.sources = [];
1399
- _this.handlers.complete();
1399
+ _this.handlers.error(reason);
1400
1400
  };
1401
1401
  _this.promise.catch(function (_) { });
1402
1402
  if (typeof sources === "function") {
@@ -5363,6 +5363,9 @@ var ObservableQuery = (function (_super) {
5363
5363
  },
5364
5364
  error: function (error) {
5365
5365
  if (equal.equal(_this.variables, variables)) {
5366
+ if (!isApolloError(error)) {
5367
+ error = new ApolloError({ networkError: error });
5368
+ }
5366
5369
  finishWaitingForOwnResult();
5367
5370
  _this.reportError(error, variables);
5368
5371
  }