@apollo/client 3.9.2 → 3.9.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,21 @@
1
1
  # @apollo/client
2
2
 
3
+ ## 3.9.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [#11403](https://github.com/apollographql/apollo-client/pull/11403) [`b0c4f3a`](https://github.com/apollographql/apollo-client/commit/b0c4f3ad8198981a229b46dc430345a76e577e9c) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Fix issue in `useLazyQuery` that results in a double network call when calling the execute function with no arguments after having called it previously with another set of arguments.
8
+
9
+ - [#11576](https://github.com/apollographql/apollo-client/pull/11576) [`e855d00`](https://github.com/apollographql/apollo-client/commit/e855d00447e4d9ae478d98f6796d842ef6cc76d1) Thanks [@alessbell](https://github.com/alessbell)! - Revert PR [#11202](https://github.com/apollographql/apollo-client/pull/11202) to fix caching bug reported in [#11560](https://github.com/apollographql/apollo-client/issues/11560)
10
+
11
+ ## 3.9.3
12
+
13
+ ### Patch Changes
14
+
15
+ - [#11525](https://github.com/apollographql/apollo-client/pull/11525) [`dce923a`](https://github.com/apollographql/apollo-client/commit/dce923ae57eb6b6d889e2980635cb90e2c6cbca3) Thanks [@vezaynk](https://github.com/vezaynk)! - Allows passing in client via options to useFragment
16
+
17
+ - [#11558](https://github.com/apollographql/apollo-client/pull/11558) [`8cba16f`](https://github.com/apollographql/apollo-client/commit/8cba16f041609443111ecf5fb58faea1b3e79569) Thanks [@alessbell](https://github.com/alessbell)! - Fix [`unbound-method`](https://github.com/apollographql/apollo-client/issues/11554) linter error on ObservableQuery methods exposed on useQuery's QueryResult object.
18
+
3
19
  ## 3.9.2
4
20
 
5
21
  ### 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.9.2";
34
+ var version = "3.9.4";
35
35
 
36
36
  function maybe(thunk) {
37
37
  try {
@@ -5908,7 +5908,6 @@ var QueryInfo = (function () {
5908
5908
  };
5909
5909
  QueryInfo.prototype.markResult = function (result, document, options, cacheWriteBehavior) {
5910
5910
  var _this = this;
5911
- result = tslib.__assign({}, result);
5912
5911
  var merger = new DeepMerger();
5913
5912
  var graphQLErrors = isNonEmptyArray(result.errors) ? result.errors.slice(0) : [];
5914
5913
  this.reset();
@@ -5935,7 +5934,7 @@ var QueryInfo = (function () {
5935
5934
  overwrite: cacheWriteBehavior === 1 ,
5936
5935
  });
5937
5936
  _this.lastWrite = {
5938
- result: tslib.__assign({}, result),
5937
+ result: result,
5939
5938
  variables: options.variables,
5940
5939
  dmCount: destructiveMethodCounts.get(_this.cache),
5941
5940
  };
@@ -5952,14 +5951,15 @@ var QueryInfo = (function () {
5952
5951
  _this.updateWatch(options.variables);
5953
5952
  }
5954
5953
  _this.updateLastDiff(diff, diffOptions);
5955
- result.data = diff.result;
5954
+ if (diff.complete) {
5955
+ result.data = diff.result;
5956
+ }
5956
5957
  });
5957
5958
  }
5958
5959
  else {
5959
5960
  this.lastWrite = void 0;
5960
5961
  }
5961
5962
  }
5962
- return result;
5963
5963
  };
5964
5964
  QueryInfo.prototype.markReady = function () {
5965
5965
  this.networkError = null;
@@ -6634,7 +6634,7 @@ var QueryManager = (function () {
6634
6634
  graphQLErrors: graphQLErrors,
6635
6635
  }));
6636
6636
  }
6637
- result = queryInfo.markResult(result, linkDocument, options, cacheWriteBehavior);
6637
+ queryInfo.markResult(result, linkDocument, options, cacheWriteBehavior);
6638
6638
  queryInfo.markReady();
6639
6639
  }
6640
6640
  var aqr = {
@@ -7669,7 +7669,7 @@ function useLazyQuery(query, options) {
7669
7669
  var queryRef = React__namespace.useRef();
7670
7670
  var merged = mergeOptions(options, execOptionsRef.current || {});
7671
7671
  var document = (_a = merged === null || merged === void 0 ? void 0 : merged.query) !== null && _a !== void 0 ? _a : query;
7672
- optionsRef.current = merged;
7672
+ optionsRef.current = options;
7673
7673
  queryRef.current = document;
7674
7674
  var internalState = useInternalState(useApolloClient(options && options.client), document);
7675
7675
  var useQueryResult = internalState.useQuery(tslib.__assign(tslib.__assign({}, merged), { skip: !execOptionsRef.current }));
@@ -8016,7 +8016,7 @@ var __use = realHook ||
8016
8016
  };
8017
8017
 
8018
8018
  function useFragment(options) {
8019
- var cache = useApolloClient().cache;
8019
+ var cache = useApolloClient(options.client).cache;
8020
8020
  var diffOptions = useDeepMemo(function () {
8021
8021
  var fragment = options.fragment, fragmentName = options.fragmentName, from = options.from, _a = options.optimistic, optimistic = _a === void 0 ? true : _a, rest = tslib.__rest(options, ["fragment", "fragmentName", "from", "optimistic"]);
8022
8022
  return tslib.__assign(tslib.__assign({}, rest), { returnPartialData: true, id: typeof from === "string" ? from : cache.identify(from), query: cache["getFragmentDoc"](fragment, fragmentName), optimistic: optimistic });