@apollo/client 3.13.2 → 3.13.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,19 @@
1
1
  # @apollo/client
2
2
 
3
+ ## 3.13.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [#12420](https://github.com/apollographql/apollo-client/pull/12420) [`fee9368`](https://github.com/apollographql/apollo-client/commit/fee9368750e242ea03dea8d1557683506d411d8d) Thanks [@jorenbroekema](https://github.com/jorenbroekema)! - Use import star from `rehackt` to prevent issues with importing named exports from external CJS modules.
8
+
9
+ ## 3.13.3
10
+
11
+ ### Patch Changes
12
+
13
+ - [#12362](https://github.com/apollographql/apollo-client/pull/12362) [`f6d387c`](https://github.com/apollographql/apollo-client/commit/f6d387c166cc76f08135966fb6d74fd8fe808c21) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Fixes an issue where calling `observableQuery.getCurrentResult()` when the `errorPolicy` was set to `all` would return the `networkStatus` as `NetworkStatus.ready` when there were errors returned in the result. This has been corrected to report `NetworkStatus.error`.
14
+
15
+ This bug also affected the `useQuery` and `useLazyQuery` hooks and may affect you if you check for `networkStatus` in your component.
16
+
3
17
  ## 3.13.2
4
18
 
5
19
  ### Patch Changes
package/apollo-client.cjs CHANGED
@@ -30,9 +30,8 @@ function _interopNamespace(e) {
30
30
 
31
31
  var equal__default = /*#__PURE__*/_interopDefaultLegacy(equal);
32
32
  var React__namespace = /*#__PURE__*/_interopNamespace(React);
33
- var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
34
33
 
35
- var version = "3.13.2";
34
+ var version = "3.13.4";
36
35
 
37
36
  function maybe(thunk) {
38
37
  try {
@@ -5286,6 +5285,10 @@ var ObservableQuery = (function (_super) {
5286
5285
  else {
5287
5286
  result.partial = true;
5288
5287
  }
5288
+ if (result.networkStatus === exports.NetworkStatus.ready &&
5289
+ (result.error || result.errors)) {
5290
+ result.networkStatus = exports.NetworkStatus.error;
5291
+ }
5289
5292
  if (globalThis.__DEV__ !== false &&
5290
5293
  !diff.complete &&
5291
5294
  !this.options.partialRefetch &&
@@ -9226,14 +9229,14 @@ function useSuspenseFragment_(options) {
9226
9229
  var client = useApolloClient(options.client);
9227
9230
  var from = options.from, variables = options.variables;
9228
9231
  var cache = client.cache;
9229
- var id = React.useMemo(function () {
9232
+ var id = React__namespace.useMemo(function () {
9230
9233
  return typeof from === "string" ? from
9231
9234
  : from === null ? null
9232
9235
  : cache.identify(from);
9233
9236
  }, [cache, from]);
9234
9237
  var fragmentRef = id === null ? null : (getSuspenseCache(client).getFragmentRef([id, options.fragment, canonicalStringify(variables)], client, tslib.__assign(tslib.__assign({}, options), { variables: variables, from: id })));
9235
- var _a = React__default.useState(fragmentRef === null ? NULL_PLACEHOLDER : ([fragmentRef.key, fragmentRef.promise])), current = _a[0], setPromise = _a[1];
9236
- React__default.useEffect(function () {
9238
+ var _a = React__namespace.useState(fragmentRef === null ? NULL_PLACEHOLDER : ([fragmentRef.key, fragmentRef.promise])), current = _a[0], setPromise = _a[1];
9239
+ React__namespace.useEffect(function () {
9237
9240
  if (fragmentRef === null) {
9238
9241
  return;
9239
9242
  }