@apollo/client 3.12.5 → 3.12.7

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 (98) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/apollo-client.cjs +17 -13
  3. package/apollo-client.cjs.map +1 -1
  4. package/apollo-client.min.cjs +1 -1
  5. package/cache/index.d.ts +1 -1
  6. package/cache/index.js +0 -1
  7. package/cache/index.js.map +1 -1
  8. package/core/core.cjs +1 -1
  9. package/core/core.cjs.map +1 -1
  10. package/core/core.cjs.native.js +1 -1
  11. package/core/index.d.ts +2 -2
  12. package/core/index.js +0 -2
  13. package/core/index.js.map +1 -1
  14. package/dev/dev.cjs +1 -1
  15. package/dev/dev.cjs.map +1 -1
  16. package/dev/dev.cjs.native.js +1 -1
  17. package/errors/index.js.map +1 -1
  18. package/link/core/index.d.ts +1 -1
  19. package/link/core/index.js +0 -1
  20. package/link/core/index.js.map +1 -1
  21. package/link/core/types.d.ts +2 -2
  22. package/link/core/types.js.map +1 -1
  23. package/link/error/error.cjs +17 -8
  24. package/link/error/error.cjs.map +1 -1
  25. package/link/error/error.cjs.native.js +17 -8
  26. package/link/error/index.d.ts +17 -1
  27. package/link/error/index.js +17 -8
  28. package/link/error/index.js.map +1 -1
  29. package/link/persisted-queries/index.d.ts +2 -2
  30. package/masking/__benches__/types.bench.js +24 -15
  31. package/masking/__benches__/types.bench.js.map +1 -1
  32. package/masking/internal/types.d.ts +2 -2
  33. package/masking/internal/types.js.map +1 -1
  34. package/masking/types.d.ts +2 -2
  35. package/masking/types.js.map +1 -1
  36. package/package.json +28 -23
  37. package/react/components/index.d.ts +1 -1
  38. package/react/components/index.js +0 -1
  39. package/react/components/index.js.map +1 -1
  40. package/react/hoc/index.d.ts +1 -1
  41. package/react/hoc/index.js +0 -1
  42. package/react/hoc/index.js.map +1 -1
  43. package/react/hooks/hooks.cjs +16 -12
  44. package/react/hooks/hooks.cjs.map +1 -1
  45. package/react/hooks/hooks.cjs.native.js +16 -12
  46. package/react/hooks/internal/useDeepMemo.js +1 -0
  47. package/react/hooks/internal/useDeepMemo.js.map +1 -1
  48. package/react/hooks/useBackgroundQuery.js +4 -2
  49. package/react/hooks/useBackgroundQuery.js.map +1 -1
  50. package/react/hooks/useFragment.js +4 -2
  51. package/react/hooks/useFragment.js.map +1 -1
  52. package/react/hooks/useMutation.js +1 -0
  53. package/react/hooks/useMutation.js.map +1 -1
  54. package/react/hooks/useQuery.js +5 -2
  55. package/react/hooks/useQuery.js.map +1 -1
  56. package/react/hooks/useQueryRefHandlers.js +2 -2
  57. package/react/hooks/useQueryRefHandlers.js.map +1 -1
  58. package/react/hooks/useReadQuery.js +2 -2
  59. package/react/hooks/useReadQuery.js.map +1 -1
  60. package/react/hooks/useSubscription.js +1 -0
  61. package/react/hooks/useSubscription.js.map +1 -1
  62. package/react/hooks/useSuspenseQuery.js +5 -2
  63. package/react/hooks/useSuspenseQuery.js.map +1 -1
  64. package/react/index.d.ts +1 -1
  65. package/react/index.js +0 -1
  66. package/react/index.js.map +1 -1
  67. package/react/internal/internal.cjs +1 -1
  68. package/react/internal/internal.cjs.map +1 -1
  69. package/react/internal/internal.cjs.native.js +1 -1
  70. package/testing/internal/ObservableStream.d.ts +11 -9
  71. package/testing/internal/ObservableStream.js +29 -4
  72. package/testing/internal/ObservableStream.js.map +1 -1
  73. package/testing/internal/incremental.d.ts +23 -0
  74. package/testing/internal/incremental.js +124 -0
  75. package/testing/internal/incremental.js.map +1 -0
  76. package/testing/internal/index.d.ts +1 -0
  77. package/testing/internal/index.js +1 -0
  78. package/testing/internal/index.js.map +1 -1
  79. package/testing/internal/scenarios/index.d.ts +1 -0
  80. package/testing/internal/scenarios/index.js.map +1 -1
  81. package/testing/matchers/index.js +4 -0
  82. package/testing/matchers/index.js.map +1 -1
  83. package/testing/matchers/toEqualApolloQueryResult.d.ts +6 -0
  84. package/testing/matchers/toEqualApolloQueryResult.js +20 -0
  85. package/testing/matchers/toEqualApolloQueryResult.js.map +1 -0
  86. package/testing/matchers/toEqualQueryResult.d.ts +9 -0
  87. package/testing/matchers/toEqualQueryResult.js +40 -0
  88. package/testing/matchers/toEqualQueryResult.js.map +1 -0
  89. package/utilities/globals/globals.cjs +1 -1
  90. package/utilities/globals/globals.cjs.map +1 -1
  91. package/utilities/globals/globals.cjs.native.js +1 -1
  92. package/utilities/index.d.ts +2 -1
  93. package/utilities/index.js +0 -1
  94. package/utilities/index.js.map +1 -1
  95. package/version.js +1 -1
  96. package/testing/core/observableToPromise.d.ts +0 -29
  97. package/testing/core/observableToPromise.js +0 -74
  98. package/testing/core/observableToPromise.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,29 @@
1
1
  # @apollo/client
2
2
 
3
+ ## 3.12.7
4
+
5
+ ### Patch Changes
6
+
7
+ - [#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.
8
+
9
+ ```js
10
+ const errorLink = onError(({ protocolErrors }) => {
11
+ if (protocolErrors) {
12
+ console.log(protocolErrors);
13
+ }
14
+ });
15
+ ```
16
+
17
+ - [#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.
18
+
19
+ ## 3.12.6
20
+
21
+ ### Patch Changes
22
+
23
+ - [#12267](https://github.com/apollographql/apollo-client/pull/12267) [`d57429d`](https://github.com/apollographql/apollo-client/commit/d57429df336412bfdce5fc92b8299360c522d121) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Maintain the `TData` type when used with `Unmasked` when `TData` is not a masked type generated from GraphQL Codegen.
24
+
25
+ - [#12270](https://github.com/apollographql/apollo-client/pull/12270) [`3601246`](https://github.com/apollographql/apollo-client/commit/3601246f6e7b4f8b2937e0d431e6b5a6964f9066) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Fix handling of tagged/branded primitive types when used as scalar values with `Unmasked`.
26
+
3
27
  ## 3.12.5
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.5";
34
+ var version = "3.12.7";
35
35
 
36
36
  function maybe(thunk) {
37
37
  try {
@@ -7875,9 +7875,10 @@ function noop() { }
7875
7875
  var lastWatchOptions = Symbol();
7876
7876
  function useQuery(query, options) {
7877
7877
  if (options === void 0) { options = Object.create(null); }
7878
- return wrapHook("useQuery", _useQuery, useApolloClient(options && options.client))(query, options);
7878
+ return wrapHook("useQuery",
7879
+ useQuery_, useApolloClient(options && options.client))(query, options);
7879
7880
  }
7880
- function _useQuery(query, options) {
7881
+ function useQuery_(query, options) {
7881
7882
  var _a = useQueryInternals(query, options), result = _a.result, obsQueryFields = _a.obsQueryFields;
7882
7883
  return React__namespace.useMemo(function () { return (tslib.__assign(tslib.__assign({}, result), obsQueryFields)); }, [result, obsQueryFields]);
7883
7884
  }
@@ -8548,9 +8549,10 @@ function useReactiveVar(rv) {
8548
8549
  }
8549
8550
 
8550
8551
  function useFragment(options) {
8551
- return wrapHook("useFragment", _useFragment, useApolloClient(options.client))(options);
8552
+ return wrapHook("useFragment",
8553
+ useFragment_, useApolloClient(options.client))(options);
8552
8554
  }
8553
- function _useFragment(options) {
8555
+ function useFragment_(options) {
8554
8556
  var client = useApolloClient(options.client);
8555
8557
  var cache = client.cache;
8556
8558
  var from = options.from, rest = tslib.__rest(options, ["from"]);
@@ -8912,9 +8914,10 @@ var skipToken = Symbol.for("apollo.skipToken");
8912
8914
 
8913
8915
  function useSuspenseQuery(query, options) {
8914
8916
  if (options === void 0) { options = Object.create(null); }
8915
- return wrapHook("useSuspenseQuery", _useSuspenseQuery, useApolloClient(typeof options === "object" ? options.client : undefined))(query, options);
8917
+ return wrapHook("useSuspenseQuery",
8918
+ useSuspenseQuery_, useApolloClient(typeof options === "object" ? options.client : undefined))(query, options);
8916
8919
  }
8917
- function _useSuspenseQuery(query, options) {
8920
+ function useSuspenseQuery_(query, options) {
8918
8921
  var client = useApolloClient(options.client);
8919
8922
  var suspenseCache = getSuspenseCache(client);
8920
8923
  var watchQueryOptions = useWatchQueryOptions({
@@ -9032,9 +9035,10 @@ function useWatchQueryOptions(_a) {
9032
9035
 
9033
9036
  function useBackgroundQuery(query, options) {
9034
9037
  if (options === void 0) { options = Object.create(null); }
9035
- return wrapHook("useBackgroundQuery", _useBackgroundQuery, useApolloClient(typeof options === "object" ? options.client : undefined))(query, options);
9038
+ return wrapHook("useBackgroundQuery",
9039
+ useBackgroundQuery_, useApolloClient(typeof options === "object" ? options.client : undefined))(query, options);
9036
9040
  }
9037
- function _useBackgroundQuery(query, options) {
9041
+ function useBackgroundQuery_(query, options) {
9038
9042
  var client = useApolloClient(options.client);
9039
9043
  var suspenseCache = getSuspenseCache(client);
9040
9044
  var watchQueryOptions = useWatchQueryOptions({ client: client, query: query, options: options });
@@ -9151,11 +9155,11 @@ function useLoadableQuery(query, options) {
9151
9155
 
9152
9156
  function useQueryRefHandlers(queryRef) {
9153
9157
  var unwrapped = unwrapQueryRef(queryRef);
9154
- return wrapHook("useQueryRefHandlers", _useQueryRefHandlers, unwrapped ?
9158
+ return wrapHook("useQueryRefHandlers", useQueryRefHandlers_, unwrapped ?
9155
9159
  unwrapped["observable"]
9156
9160
  : useApolloClient())(queryRef);
9157
9161
  }
9158
- function _useQueryRefHandlers(queryRef) {
9162
+ function useQueryRefHandlers_(queryRef) {
9159
9163
  assertWrappedQueryRef(queryRef);
9160
9164
  var _a = React__namespace.useState(queryRef), previousQueryRef = _a[0], setPreviousQueryRef = _a[1];
9161
9165
  var _b = React__namespace.useState(queryRef), wrappedQueryRef = _b[0], setWrappedQueryRef = _b[1];
@@ -9186,11 +9190,11 @@ function _useQueryRefHandlers(queryRef) {
9186
9190
 
9187
9191
  function useReadQuery(queryRef) {
9188
9192
  var unwrapped = unwrapQueryRef(queryRef);
9189
- return wrapHook("useReadQuery", _useReadQuery, unwrapped ?
9193
+ return wrapHook("useReadQuery", useReadQuery_, unwrapped ?
9190
9194
  unwrapped["observable"]
9191
9195
  : useApolloClient())(queryRef);
9192
9196
  }
9193
- function _useReadQuery(queryRef) {
9197
+ function useReadQuery_(queryRef) {
9194
9198
  assertWrappedQueryRef(queryRef);
9195
9199
  var internalQueryRef = React__namespace.useMemo(function () { return unwrapQueryRef(queryRef); }, [queryRef]);
9196
9200
  var getPromise = React__namespace.useCallback(function () { return getWrappedPromise(queryRef); }, [queryRef]);