@apollo/client 3.10.1 → 3.10.3

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 (41) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/apollo-client.cjs +14 -20
  3. package/apollo-client.cjs.map +1 -1
  4. package/apollo-client.min.cjs +1 -1
  5. package/cache/cache.cjs +1 -1
  6. package/cache/cache.cjs.map +1 -1
  7. package/cache/cache.cjs.native.js +1 -1
  8. package/cache/inmemory/writeToStore.js +1 -1
  9. package/cache/inmemory/writeToStore.js.map +1 -1
  10. package/core/core.cjs +1 -1
  11. package/core/core.cjs.map +1 -1
  12. package/core/core.cjs.native.js +1 -1
  13. package/dev/dev.cjs +1 -1
  14. package/dev/dev.cjs.map +1 -1
  15. package/dev/dev.cjs.native.js +1 -1
  16. package/link/http/selectURI.d.ts +1 -1
  17. package/package.json +24 -24
  18. package/react/context/ApolloConsumer.d.ts +1 -1
  19. package/react/context/ApolloConsumer.js.map +1 -1
  20. package/react/hooks/hooks.cjs +7 -15
  21. package/react/hooks/hooks.cjs.map +1 -1
  22. package/react/hooks/hooks.cjs.native.js +7 -15
  23. package/react/hooks/useBackgroundQuery.js +13 -9
  24. package/react/hooks/useBackgroundQuery.js.map +1 -1
  25. package/react/hooks/useReadQuery.js +1 -10
  26. package/react/hooks/useReadQuery.js.map +1 -1
  27. package/react/hooks/useSuspenseQuery.js +0 -27
  28. package/react/hooks/useSuspenseQuery.js.map +1 -1
  29. package/react/internal/cache/QueryReference.js +5 -3
  30. package/react/internal/cache/QueryReference.js.map +1 -1
  31. package/react/internal/internal.cjs +5 -3
  32. package/react/internal/internal.cjs.map +1 -1
  33. package/react/internal/internal.cjs.native.js +5 -3
  34. package/react/types/types.d.ts +1 -1
  35. package/react/types/types.js.map +1 -1
  36. package/testing/experimental/createSchemaFetch.d.ts +0 -1
  37. package/utilities/globals/globals.cjs +1 -1
  38. package/utilities/globals/globals.cjs.map +1 -1
  39. package/utilities/globals/globals.cjs.native.js +1 -1
  40. package/utilities/subscriptions/urql/index.d.ts +1 -1
  41. package/version.js +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @apollo/client
2
2
 
3
+ ## 3.10.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#11811](https://github.com/apollographql/apollo-client/pull/11811) [`d67d7f9`](https://github.com/apollographql/apollo-client/commit/d67d7f9a2943273cacaefb26a54184e81f12b022) Thanks [@phryneas](https://github.com/phryneas)! - Adjust some types for React 19 compat
8
+
9
+ - [#11834](https://github.com/apollographql/apollo-client/pull/11834) [`7d8aad4`](https://github.com/apollographql/apollo-client/commit/7d8aad4a00b89e0208ee1563293c24025e6604ce) Thanks [@psamim](https://github.com/psamim)! - Fix error "Cannot convert object to primitive value"
10
+
11
+ ## 3.10.2
12
+
13
+ ### Patch Changes
14
+
15
+ - [#11821](https://github.com/apollographql/apollo-client/pull/11821) [`2675d3c`](https://github.com/apollographql/apollo-client/commit/2675d3c97e6c47c6e298382004c7c9c2d3ffed0c) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Fix a regression where rerendering a component with `useBackgroundQuery` would recreate the `queryRef` instance when used with React's strict mode.
16
+
17
+ - [#11821](https://github.com/apollographql/apollo-client/pull/11821) [`2675d3c`](https://github.com/apollographql/apollo-client/commit/2675d3c97e6c47c6e298382004c7c9c2d3ffed0c) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Revert the change introduced in
18
+ [3.9.10](https://github.com/apollographql/apollo-client/releases/tag/v3.9.10) via #11738 that disposed of queryRefs synchronously. This change caused too many issues with strict mode.
19
+
3
20
  ## 3.10.1
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.10.1";
34
+ var version = "3.10.3";
35
35
 
36
36
  function maybe(thunk) {
37
37
  try {
@@ -4480,7 +4480,7 @@ function warnAboutDataLoss(existingRef, incomingObj, storeFieldName, store) {
4480
4480
  "either ensure all objects of type " +
4481
4481
  childTypenames.join(" and ") +
4482
4482
  " have an ID or a custom merge function, or "
4483
- : "", typeDotName, existing, incoming);
4483
+ : "", typeDotName, tslib.__assign({}, existing), tslib.__assign({}, incoming));
4484
4484
  }
4485
4485
 
4486
4486
  var InMemoryCache = (function (_super) {
@@ -8225,9 +8225,11 @@ var InternalQueryReference = (function () {
8225
8225
  }
8226
8226
  disposed = true;
8227
8227
  _this.references--;
8228
- if (!_this.references) {
8229
- _this.dispose();
8230
- }
8228
+ setTimeout(function () {
8229
+ if (!_this.references) {
8230
+ _this.dispose();
8231
+ }
8232
+ });
8231
8233
  };
8232
8234
  };
8233
8235
  InternalQueryReference.prototype.softRetain = function () {
@@ -8453,12 +8455,6 @@ function _useSuspenseQuery(query, options) {
8453
8455
  dispose();
8454
8456
  };
8455
8457
  }, [queryRef]);
8456
- React__namespace.useEffect(function () {
8457
- if (queryRef.disposed) {
8458
- suspenseCache.add(cacheKey, queryRef);
8459
- queryRef.reinitialize();
8460
- }
8461
- });
8462
8458
  var skipResult = React__namespace.useMemo(function () {
8463
8459
  var error = toApolloError(queryRef.result);
8464
8460
  return {
@@ -8567,9 +8563,12 @@ function _useBackgroundQuery(query, options) {
8567
8563
  updateWrappedQueryRef(wrappedQueryRef, promise);
8568
8564
  }
8569
8565
  React__namespace.useEffect(function () {
8570
- if (queryRef.disposed) {
8571
- suspenseCache.add(cacheKey, queryRef);
8572
- }
8566
+ var id = setTimeout(function () {
8567
+ if (queryRef.disposed) {
8568
+ suspenseCache.add(cacheKey, queryRef);
8569
+ }
8570
+ });
8571
+ return function () { return clearTimeout(id); };
8573
8572
  });
8574
8573
  var fetchMore = React__namespace.useCallback(function (options) {
8575
8574
  var promise = queryRef.fetchMore(options);
@@ -8682,12 +8681,7 @@ function _useReadQuery(queryRef) {
8682
8681
  internalQueryRef.reinitialize();
8683
8682
  updateWrappedQueryRef(queryRef, internalQueryRef.promise);
8684
8683
  }
8685
- React__namespace.useEffect(function () {
8686
- if (internalQueryRef.disposed) {
8687
- internalQueryRef.reinitialize();
8688
- }
8689
- return internalQueryRef.retain();
8690
- }, [internalQueryRef]);
8684
+ React__namespace.useEffect(function () { return internalQueryRef.retain(); }, [internalQueryRef]);
8691
8685
  var promise = useSyncExternalStore(React__namespace.useCallback(function (forceUpdate) {
8692
8686
  return internalQueryRef.listen(function (promise) {
8693
8687
  updateWrappedQueryRef(queryRef, promise);