@apollo/client 3.12.6 → 3.12.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 (96) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/apollo-client.cjs +19 -14
  3. package/apollo-client.cjs.map +1 -1
  4. package/apollo-client.min.cjs +1 -1
  5. package/cache/cache.cjs +2 -1
  6. package/cache/cache.cjs.map +1 -1
  7. package/cache/cache.cjs.native.js +2 -1
  8. package/cache/core/cache.js +4 -1
  9. package/cache/core/cache.js.map +1 -1
  10. package/cache/index.d.ts +1 -1
  11. package/cache/index.js +0 -1
  12. package/cache/index.js.map +1 -1
  13. package/core/core.cjs +1 -1
  14. package/core/core.cjs.map +1 -1
  15. package/core/core.cjs.native.js +1 -1
  16. package/core/index.d.ts +2 -2
  17. package/core/index.js +0 -2
  18. package/core/index.js.map +1 -1
  19. package/dev/dev.cjs +1 -1
  20. package/dev/dev.cjs.map +1 -1
  21. package/dev/dev.cjs.native.js +1 -1
  22. package/errors/index.js.map +1 -1
  23. package/link/core/index.d.ts +1 -1
  24. package/link/core/index.js +0 -1
  25. package/link/core/index.js.map +1 -1
  26. package/link/core/types.d.ts +2 -2
  27. package/link/core/types.js.map +1 -1
  28. package/link/error/error.cjs +17 -8
  29. package/link/error/error.cjs.map +1 -1
  30. package/link/error/error.cjs.native.js +17 -8
  31. package/link/error/index.d.ts +17 -1
  32. package/link/error/index.js +17 -8
  33. package/link/error/index.js.map +1 -1
  34. package/link/persisted-queries/index.d.ts +2 -2
  35. package/package.json +28 -24
  36. package/react/components/index.d.ts +1 -1
  37. package/react/components/index.js +0 -1
  38. package/react/components/index.js.map +1 -1
  39. package/react/hoc/index.d.ts +1 -1
  40. package/react/hoc/index.js +0 -1
  41. package/react/hoc/index.js.map +1 -1
  42. package/react/hooks/hooks.cjs +16 -12
  43. package/react/hooks/hooks.cjs.map +1 -1
  44. package/react/hooks/hooks.cjs.native.js +16 -12
  45. package/react/hooks/internal/useDeepMemo.js +1 -0
  46. package/react/hooks/internal/useDeepMemo.js.map +1 -1
  47. package/react/hooks/useBackgroundQuery.js +4 -2
  48. package/react/hooks/useBackgroundQuery.js.map +1 -1
  49. package/react/hooks/useFragment.js +4 -2
  50. package/react/hooks/useFragment.js.map +1 -1
  51. package/react/hooks/useMutation.js +1 -0
  52. package/react/hooks/useMutation.js.map +1 -1
  53. package/react/hooks/useQuery.js +5 -2
  54. package/react/hooks/useQuery.js.map +1 -1
  55. package/react/hooks/useQueryRefHandlers.js +2 -2
  56. package/react/hooks/useQueryRefHandlers.js.map +1 -1
  57. package/react/hooks/useReadQuery.js +2 -2
  58. package/react/hooks/useReadQuery.js.map +1 -1
  59. package/react/hooks/useSubscription.js +1 -0
  60. package/react/hooks/useSubscription.js.map +1 -1
  61. package/react/hooks/useSuspenseQuery.js +5 -2
  62. package/react/hooks/useSuspenseQuery.js.map +1 -1
  63. package/react/index.d.ts +1 -1
  64. package/react/index.js +0 -1
  65. package/react/index.js.map +1 -1
  66. package/react/internal/internal.cjs +1 -1
  67. package/react/internal/internal.cjs.map +1 -1
  68. package/react/internal/internal.cjs.native.js +1 -1
  69. package/testing/internal/ObservableStream.d.ts +3 -0
  70. package/testing/internal/ObservableStream.js +30 -1
  71. package/testing/internal/ObservableStream.js.map +1 -1
  72. package/testing/internal/incremental.d.ts +23 -0
  73. package/testing/internal/incremental.js +124 -0
  74. package/testing/internal/incremental.js.map +1 -0
  75. package/testing/internal/index.d.ts +1 -0
  76. package/testing/internal/index.js +1 -0
  77. package/testing/internal/index.js.map +1 -1
  78. package/testing/internal/scenarios/index.d.ts +1 -0
  79. package/testing/internal/scenarios/index.js.map +1 -1
  80. package/testing/matchers/index.js +4 -0
  81. package/testing/matchers/index.js.map +1 -1
  82. package/testing/matchers/toEmitAnything.js +1 -1
  83. package/testing/matchers/toEmitAnything.js.map +1 -1
  84. package/testing/matchers/toEqualApolloQueryResult.d.ts +6 -0
  85. package/testing/matchers/toEqualApolloQueryResult.js +20 -0
  86. package/testing/matchers/toEqualApolloQueryResult.js.map +1 -0
  87. package/testing/matchers/toEqualQueryResult.d.ts +9 -0
  88. package/testing/matchers/toEqualQueryResult.js +40 -0
  89. package/testing/matchers/toEqualQueryResult.js.map +1 -0
  90. package/utilities/globals/globals.cjs +1 -1
  91. package/utilities/globals/globals.cjs.map +1 -1
  92. package/utilities/globals/globals.cjs.native.js +1 -1
  93. package/utilities/index.d.ts +1 -1
  94. package/utilities/index.js +0 -1
  95. package/utilities/index.js.map +1 -1
  96. package/version.js +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,29 @@
1
1
  # @apollo/client
2
2
 
3
+ ## 3.12.8
4
+
5
+ ### Patch Changes
6
+
7
+ - [#12292](https://github.com/apollographql/apollo-client/pull/12292) [`3abd944`](https://github.com/apollographql/apollo-client/commit/3abd944e4adde5d94d91133f2bf6ed1c7744f8c5) Thanks [@phryneas](https://github.com/phryneas)! - Remove unused dependency `response-iterator`
8
+
9
+ - [#12287](https://github.com/apollographql/apollo-client/pull/12287) [`bf313a3`](https://github.com/apollographql/apollo-client/commit/bf313a39d342a73dc3e9b3db9415c71c2573db3f) Thanks [@phryneas](https://github.com/phryneas)! - Fixes an issue where `client.watchFragment`/`useFragment` with `@includes` crashes when a separate cache update writes to the conditionally included fields.
10
+
11
+ ## 3.12.7
12
+
13
+ ### Patch Changes
14
+
15
+ - [#12281](https://github.com/apollographql/apollo-client/pull/12281) [`d638ec3`](https://github.com/apollographql/apollo-client/commit/d638ec317b7d21c2246251ef1b9d773588277b39) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Make fatal [tranport-level errors](https://www.apollographql.com/docs/graphos/routing/operations/subscriptions/multipart-protocol#message-and-error-format) from multipart subscriptions available to the error link with the `protocolErrors` property.
16
+
17
+ ```js
18
+ const errorLink = onError(({ protocolErrors }) => {
19
+ if (protocolErrors) {
20
+ console.log(protocolErrors);
21
+ }
22
+ });
23
+ ```
24
+
25
+ - [#12281](https://github.com/apollographql/apollo-client/pull/12281) [`d638ec3`](https://github.com/apollographql/apollo-client/commit/d638ec317b7d21c2246251ef1b9d773588277b39) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Fix the array type for the `errors` field on the `ApolloPayloadResult` type. This type was always in the shape of the GraphQL error format, per the [multipart subscriptions protocol](https://www.apollographql.com/docs/graphos/routing/operations/subscriptions/multipart-protocol#message-and-error-format) and never a plain string or a JavaScript error object.
26
+
3
27
  ## 3.12.6
4
28
 
5
29
  ### 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.12.6";
34
+ var version = "3.12.8";
35
35
 
36
36
  function maybe(thunk) {
37
37
  try {
@@ -2782,7 +2782,8 @@ var ApolloCache = (function () {
2782
2782
  : diff.result;
2783
2783
  if (
2784
2784
  latestDiff &&
2785
- equalByQuery(query, { data: latestDiff === null || latestDiff === void 0 ? void 0 : latestDiff.result }, { data: data })) {
2785
+ equalByQuery(query, { data: latestDiff.result }, { data: data },
2786
+ options.variables)) {
2786
2787
  return;
2787
2788
  }
2788
2789
  var result = {
@@ -7875,9 +7876,10 @@ function noop() { }
7875
7876
  var lastWatchOptions = Symbol();
7876
7877
  function useQuery(query, options) {
7877
7878
  if (options === void 0) { options = Object.create(null); }
7878
- return wrapHook("useQuery", _useQuery, useApolloClient(options && options.client))(query, options);
7879
+ return wrapHook("useQuery",
7880
+ useQuery_, useApolloClient(options && options.client))(query, options);
7879
7881
  }
7880
- function _useQuery(query, options) {
7882
+ function useQuery_(query, options) {
7881
7883
  var _a = useQueryInternals(query, options), result = _a.result, obsQueryFields = _a.obsQueryFields;
7882
7884
  return React__namespace.useMemo(function () { return (tslib.__assign(tslib.__assign({}, result), obsQueryFields)); }, [result, obsQueryFields]);
7883
7885
  }
@@ -8548,9 +8550,10 @@ function useReactiveVar(rv) {
8548
8550
  }
8549
8551
 
8550
8552
  function useFragment(options) {
8551
- return wrapHook("useFragment", _useFragment, useApolloClient(options.client))(options);
8553
+ return wrapHook("useFragment",
8554
+ useFragment_, useApolloClient(options.client))(options);
8552
8555
  }
8553
- function _useFragment(options) {
8556
+ function useFragment_(options) {
8554
8557
  var client = useApolloClient(options.client);
8555
8558
  var cache = client.cache;
8556
8559
  var from = options.from, rest = tslib.__rest(options, ["from"]);
@@ -8912,9 +8915,10 @@ var skipToken = Symbol.for("apollo.skipToken");
8912
8915
 
8913
8916
  function useSuspenseQuery(query, options) {
8914
8917
  if (options === void 0) { options = Object.create(null); }
8915
- return wrapHook("useSuspenseQuery", _useSuspenseQuery, useApolloClient(typeof options === "object" ? options.client : undefined))(query, options);
8918
+ return wrapHook("useSuspenseQuery",
8919
+ useSuspenseQuery_, useApolloClient(typeof options === "object" ? options.client : undefined))(query, options);
8916
8920
  }
8917
- function _useSuspenseQuery(query, options) {
8921
+ function useSuspenseQuery_(query, options) {
8918
8922
  var client = useApolloClient(options.client);
8919
8923
  var suspenseCache = getSuspenseCache(client);
8920
8924
  var watchQueryOptions = useWatchQueryOptions({
@@ -9032,9 +9036,10 @@ function useWatchQueryOptions(_a) {
9032
9036
 
9033
9037
  function useBackgroundQuery(query, options) {
9034
9038
  if (options === void 0) { options = Object.create(null); }
9035
- return wrapHook("useBackgroundQuery", _useBackgroundQuery, useApolloClient(typeof options === "object" ? options.client : undefined))(query, options);
9039
+ return wrapHook("useBackgroundQuery",
9040
+ useBackgroundQuery_, useApolloClient(typeof options === "object" ? options.client : undefined))(query, options);
9036
9041
  }
9037
- function _useBackgroundQuery(query, options) {
9042
+ function useBackgroundQuery_(query, options) {
9038
9043
  var client = useApolloClient(options.client);
9039
9044
  var suspenseCache = getSuspenseCache(client);
9040
9045
  var watchQueryOptions = useWatchQueryOptions({ client: client, query: query, options: options });
@@ -9151,11 +9156,11 @@ function useLoadableQuery(query, options) {
9151
9156
 
9152
9157
  function useQueryRefHandlers(queryRef) {
9153
9158
  var unwrapped = unwrapQueryRef(queryRef);
9154
- return wrapHook("useQueryRefHandlers", _useQueryRefHandlers, unwrapped ?
9159
+ return wrapHook("useQueryRefHandlers", useQueryRefHandlers_, unwrapped ?
9155
9160
  unwrapped["observable"]
9156
9161
  : useApolloClient())(queryRef);
9157
9162
  }
9158
- function _useQueryRefHandlers(queryRef) {
9163
+ function useQueryRefHandlers_(queryRef) {
9159
9164
  assertWrappedQueryRef(queryRef);
9160
9165
  var _a = React__namespace.useState(queryRef), previousQueryRef = _a[0], setPreviousQueryRef = _a[1];
9161
9166
  var _b = React__namespace.useState(queryRef), wrappedQueryRef = _b[0], setWrappedQueryRef = _b[1];
@@ -9186,11 +9191,11 @@ function _useQueryRefHandlers(queryRef) {
9186
9191
 
9187
9192
  function useReadQuery(queryRef) {
9188
9193
  var unwrapped = unwrapQueryRef(queryRef);
9189
- return wrapHook("useReadQuery", _useReadQuery, unwrapped ?
9194
+ return wrapHook("useReadQuery", useReadQuery_, unwrapped ?
9190
9195
  unwrapped["observable"]
9191
9196
  : useApolloClient())(queryRef);
9192
9197
  }
9193
- function _useReadQuery(queryRef) {
9198
+ function useReadQuery_(queryRef) {
9194
9199
  assertWrappedQueryRef(queryRef);
9195
9200
  var internalQueryRef = React__namespace.useMemo(function () { return unwrapQueryRef(queryRef); }, [queryRef]);
9196
9201
  var getPromise = React__namespace.useCallback(function () { return getWrappedPromise(queryRef); }, [queryRef]);