@apollo/client 3.7.6 → 3.7.8

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.
Files changed (56) hide show
  1. package/README.md +1 -0
  2. package/apollo-client.cjs +9 -7
  3. package/apollo-client.cjs.map +1 -1
  4. package/apollo-client.min.cjs +1 -1
  5. package/core/LocalState.d.ts.map +1 -1
  6. package/core/LocalState.js +3 -0
  7. package/core/LocalState.js.map +1 -1
  8. package/core/core.cjs +4 -1
  9. package/core/core.cjs.map +1 -1
  10. package/core/core.cjs.native.js +4 -1
  11. package/invariantErrorCodes.js +1 -1
  12. package/link/core/types.d.ts +5 -6
  13. package/link/core/types.d.ts.map +1 -1
  14. package/link/core/types.js.map +1 -1
  15. package/package.json +12 -12
  16. package/react/hooks/hooks.cjs +3 -4
  17. package/react/hooks/hooks.cjs.map +1 -1
  18. package/react/hooks/hooks.cjs.native.js +3 -4
  19. package/react/hooks/useLazyQuery.d.ts.map +1 -1
  20. package/react/hooks/useLazyQuery.js +3 -4
  21. package/react/hooks/useLazyQuery.js.map +1 -1
  22. package/testing/core/core.cjs +12 -2
  23. package/testing/core/core.cjs.map +1 -1
  24. package/testing/core/core.cjs.native.js +12 -2
  25. package/testing/core/index.d.ts +1 -1
  26. package/testing/core/index.d.ts.map +1 -1
  27. package/testing/core/index.js.map +1 -1
  28. package/testing/core/mocking/mockLink.d.ts +7 -3
  29. package/testing/core/mocking/mockLink.d.ts.map +1 -1
  30. package/testing/core/mocking/mockLink.js +12 -2
  31. package/testing/core/mocking/mockLink.js.map +1 -1
  32. package/testing/core/mocking/mockQueryManager.d.ts +1 -1
  33. package/testing/core/mocking/mockQueryManager.d.ts.map +1 -1
  34. package/testing/core/mocking/mockQueryManager.js +3 -3
  35. package/testing/core/mocking/mockQueryManager.js.map +1 -1
  36. package/testing/core/mocking/mockWatchQuery.d.ts +1 -1
  37. package/testing/core/mocking/mockWatchQuery.d.ts.map +1 -1
  38. package/testing/core/mocking/mockWatchQuery.js +4 -5
  39. package/testing/core/mocking/mockWatchQuery.js.map +1 -1
  40. package/testing/react/MockedProvider.d.ts +1 -0
  41. package/testing/react/MockedProvider.d.ts.map +1 -1
  42. package/testing/react/MockedProvider.js +2 -2
  43. package/testing/react/MockedProvider.js.map +1 -1
  44. package/testing/testing.cjs +2 -2
  45. package/testing/testing.cjs.map +1 -1
  46. package/testing/testing.cjs.native.js +2 -2
  47. package/utilities/common/mergeOptions.d.ts +1 -1
  48. package/utilities/common/mergeOptions.d.ts.map +1 -1
  49. package/utilities/common/mergeOptions.js.map +1 -1
  50. package/utilities/observables/Concast.d.ts.map +1 -1
  51. package/utilities/observables/Concast.js +2 -2
  52. package/utilities/observables/Concast.js.map +1 -1
  53. package/utilities/utilities.cjs +2 -2
  54. package/utilities/utilities.cjs.map +1 -1
  55. package/utilities/utilities.cjs.native.js +2 -2
  56. package/version.js +1 -1
package/README.md CHANGED
@@ -29,6 +29,7 @@ Learn how to use Apollo Client with self-paced hands-on training on Odyssey, Apo
29
29
  |Jeff Auriemma|[@bignimbus](https://github.com/bignimbus)|
30
30
  |Hugh Willson|[@hwillson](https://github.com/hwillson)|
31
31
  |Jerel Miller|[@jerelmiller](https://github.com/jerelmiller)|
32
+ |Lenz Weber-Tronic|[@phryneas](https://github.com/phryneas)|
32
33
 
33
34
  ## Who is Apollo?
34
35
 
package/apollo-client.cjs CHANGED
@@ -953,9 +953,9 @@ var Concast = (function (_super) {
953
953
  }
954
954
  },
955
955
  complete: function () {
956
- var sub = _this.sub;
956
+ var _a = _this, sub = _a.sub, _b = _a.sources, sources = _b === void 0 ? [] : _b;
957
957
  if (sub !== null) {
958
- var value = _this.sources.shift();
958
+ var value = sources.shift();
959
959
  if (!value) {
960
960
  if (sub)
961
961
  setTimeout(function () { return sub.unsubscribe(); });
@@ -1345,7 +1345,7 @@ var concat = ApolloLink.concat;
1345
1345
 
1346
1346
  var execute = ApolloLink.execute;
1347
1347
 
1348
- var version = '3.7.6';
1348
+ var version = '3.7.8';
1349
1349
 
1350
1350
  function isNodeResponse(value) {
1351
1351
  return !!value.body;
@@ -4964,6 +4964,9 @@ var LocalState = (function () {
4964
4964
  var variables, fieldName, aliasedFieldName, aliasUsed, defaultResult, resultPromise, resolverType, resolverMap, resolve;
4965
4965
  var _this = this;
4966
4966
  return tslib.__generator(this, function (_a) {
4967
+ if (!rootValue) {
4968
+ return [2, null];
4969
+ }
4967
4970
  variables = execContext.variables;
4968
4971
  fieldName = field.name.value;
4969
4972
  aliasedFieldName = resultKeyNameFromField(field);
@@ -6939,12 +6942,11 @@ var EAGER_METHODS = [
6939
6942
  'subscribeToMore',
6940
6943
  ];
6941
6944
  function useLazyQuery(query, options) {
6945
+ var _a;
6942
6946
  var abortControllersRef = React.useRef(new Set());
6943
- var internalState = useInternalState(useApolloClient(options && options.client), query);
6944
6947
  var execOptionsRef = React.useRef();
6945
- var merged = execOptionsRef.current
6946
- ? mergeOptions(options, execOptionsRef.current)
6947
- : options;
6948
+ var merged = execOptionsRef.current ? mergeOptions(options, execOptionsRef.current) : options;
6949
+ var internalState = useInternalState(useApolloClient(options && options.client), (_a = merged === null || merged === void 0 ? void 0 : merged.query) !== null && _a !== void 0 ? _a : query);
6948
6950
  var useQueryResult = internalState.useQuery(tslib.__assign(tslib.__assign({}, merged), { skip: !execOptionsRef.current }));
6949
6951
  var initialFetchPolicy = useQueryResult.observable.options.initialFetchPolicy ||
6950
6952
  internalState.getDefaultFetchPolicy();