@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.
- package/CHANGELOG.md +24 -0
- package/apollo-client.cjs +17 -13
- package/apollo-client.cjs.map +1 -1
- package/apollo-client.min.cjs +1 -1
- package/cache/index.d.ts +1 -1
- package/cache/index.js +0 -1
- package/cache/index.js.map +1 -1
- package/core/core.cjs +1 -1
- package/core/core.cjs.map +1 -1
- package/core/core.cjs.native.js +1 -1
- package/core/index.d.ts +2 -2
- package/core/index.js +0 -2
- package/core/index.js.map +1 -1
- package/dev/dev.cjs +1 -1
- package/dev/dev.cjs.map +1 -1
- package/dev/dev.cjs.native.js +1 -1
- package/errors/index.js.map +1 -1
- package/link/core/index.d.ts +1 -1
- package/link/core/index.js +0 -1
- package/link/core/index.js.map +1 -1
- package/link/core/types.d.ts +2 -2
- package/link/core/types.js.map +1 -1
- package/link/error/error.cjs +17 -8
- package/link/error/error.cjs.map +1 -1
- package/link/error/error.cjs.native.js +17 -8
- package/link/error/index.d.ts +17 -1
- package/link/error/index.js +17 -8
- package/link/error/index.js.map +1 -1
- package/link/persisted-queries/index.d.ts +2 -2
- package/masking/__benches__/types.bench.js +24 -15
- package/masking/__benches__/types.bench.js.map +1 -1
- package/masking/internal/types.d.ts +2 -2
- package/masking/internal/types.js.map +1 -1
- package/masking/types.d.ts +2 -2
- package/masking/types.js.map +1 -1
- package/package.json +28 -23
- package/react/components/index.d.ts +1 -1
- package/react/components/index.js +0 -1
- package/react/components/index.js.map +1 -1
- package/react/hoc/index.d.ts +1 -1
- package/react/hoc/index.js +0 -1
- package/react/hoc/index.js.map +1 -1
- package/react/hooks/hooks.cjs +16 -12
- package/react/hooks/hooks.cjs.map +1 -1
- package/react/hooks/hooks.cjs.native.js +16 -12
- package/react/hooks/internal/useDeepMemo.js +1 -0
- package/react/hooks/internal/useDeepMemo.js.map +1 -1
- package/react/hooks/useBackgroundQuery.js +4 -2
- package/react/hooks/useBackgroundQuery.js.map +1 -1
- package/react/hooks/useFragment.js +4 -2
- package/react/hooks/useFragment.js.map +1 -1
- package/react/hooks/useMutation.js +1 -0
- package/react/hooks/useMutation.js.map +1 -1
- package/react/hooks/useQuery.js +5 -2
- package/react/hooks/useQuery.js.map +1 -1
- package/react/hooks/useQueryRefHandlers.js +2 -2
- package/react/hooks/useQueryRefHandlers.js.map +1 -1
- package/react/hooks/useReadQuery.js +2 -2
- package/react/hooks/useReadQuery.js.map +1 -1
- package/react/hooks/useSubscription.js +1 -0
- package/react/hooks/useSubscription.js.map +1 -1
- package/react/hooks/useSuspenseQuery.js +5 -2
- package/react/hooks/useSuspenseQuery.js.map +1 -1
- package/react/index.d.ts +1 -1
- package/react/index.js +0 -1
- package/react/index.js.map +1 -1
- package/react/internal/internal.cjs +1 -1
- package/react/internal/internal.cjs.map +1 -1
- package/react/internal/internal.cjs.native.js +1 -1
- package/testing/internal/ObservableStream.d.ts +11 -9
- package/testing/internal/ObservableStream.js +29 -4
- package/testing/internal/ObservableStream.js.map +1 -1
- package/testing/internal/incremental.d.ts +23 -0
- package/testing/internal/incremental.js +124 -0
- package/testing/internal/incremental.js.map +1 -0
- package/testing/internal/index.d.ts +1 -0
- package/testing/internal/index.js +1 -0
- package/testing/internal/index.js.map +1 -1
- package/testing/internal/scenarios/index.d.ts +1 -0
- package/testing/internal/scenarios/index.js.map +1 -1
- package/testing/matchers/index.js +4 -0
- package/testing/matchers/index.js.map +1 -1
- package/testing/matchers/toEqualApolloQueryResult.d.ts +6 -0
- package/testing/matchers/toEqualApolloQueryResult.js +20 -0
- package/testing/matchers/toEqualApolloQueryResult.js.map +1 -0
- package/testing/matchers/toEqualQueryResult.d.ts +9 -0
- package/testing/matchers/toEqualQueryResult.js +40 -0
- package/testing/matchers/toEqualQueryResult.js.map +1 -0
- package/utilities/globals/globals.cjs +1 -1
- package/utilities/globals/globals.cjs.map +1 -1
- package/utilities/globals/globals.cjs.native.js +1 -1
- package/utilities/index.d.ts +2 -1
- package/utilities/index.js +0 -1
- package/utilities/index.js.map +1 -1
- package/version.js +1 -1
- package/testing/core/observableToPromise.d.ts +0 -29
- package/testing/core/observableToPromise.js +0 -74
- package/testing/core/observableToPromise.js.map +0 -1
package/react/hooks/hooks.cjs
CHANGED
|
@@ -148,9 +148,10 @@ function noop() { }
|
|
|
148
148
|
var lastWatchOptions = Symbol();
|
|
149
149
|
function useQuery(query, options) {
|
|
150
150
|
if (options === void 0) { options = Object.create(null); }
|
|
151
|
-
return wrapHook("useQuery",
|
|
151
|
+
return wrapHook("useQuery",
|
|
152
|
+
useQuery_, useApolloClient(options && options.client))(query, options);
|
|
152
153
|
}
|
|
153
|
-
function
|
|
154
|
+
function useQuery_(query, options) {
|
|
154
155
|
var _a = useQueryInternals(query, options), result = _a.result, obsQueryFields = _a.obsQueryFields;
|
|
155
156
|
return React__namespace.useMemo(function () { return (tslib.__assign(tslib.__assign({}, result), obsQueryFields)); }, [result, obsQueryFields]);
|
|
156
157
|
}
|
|
@@ -821,9 +822,10 @@ function useReactiveVar(rv) {
|
|
|
821
822
|
}
|
|
822
823
|
|
|
823
824
|
function useFragment(options) {
|
|
824
|
-
return wrapHook("useFragment",
|
|
825
|
+
return wrapHook("useFragment",
|
|
826
|
+
useFragment_, useApolloClient(options.client))(options);
|
|
825
827
|
}
|
|
826
|
-
function
|
|
828
|
+
function useFragment_(options) {
|
|
827
829
|
var client = useApolloClient(options.client);
|
|
828
830
|
var cache = client.cache;
|
|
829
831
|
var from = options.from, rest = tslib.__rest(options, ["from"]);
|
|
@@ -888,9 +890,10 @@ var skipToken = Symbol.for("apollo.skipToken");
|
|
|
888
890
|
|
|
889
891
|
function useSuspenseQuery(query, options) {
|
|
890
892
|
if (options === void 0) { options = Object.create(null); }
|
|
891
|
-
return wrapHook("useSuspenseQuery",
|
|
893
|
+
return wrapHook("useSuspenseQuery",
|
|
894
|
+
useSuspenseQuery_, useApolloClient(typeof options === "object" ? options.client : undefined))(query, options);
|
|
892
895
|
}
|
|
893
|
-
function
|
|
896
|
+
function useSuspenseQuery_(query, options) {
|
|
894
897
|
var client = useApolloClient(options.client);
|
|
895
898
|
var suspenseCache = internal.getSuspenseCache(client);
|
|
896
899
|
var watchQueryOptions = useWatchQueryOptions({
|
|
@@ -1008,9 +1011,10 @@ function useWatchQueryOptions(_a) {
|
|
|
1008
1011
|
|
|
1009
1012
|
function useBackgroundQuery(query, options) {
|
|
1010
1013
|
if (options === void 0) { options = Object.create(null); }
|
|
1011
|
-
return wrapHook("useBackgroundQuery",
|
|
1014
|
+
return wrapHook("useBackgroundQuery",
|
|
1015
|
+
useBackgroundQuery_, useApolloClient(typeof options === "object" ? options.client : undefined))(query, options);
|
|
1012
1016
|
}
|
|
1013
|
-
function
|
|
1017
|
+
function useBackgroundQuery_(query, options) {
|
|
1014
1018
|
var client = useApolloClient(options.client);
|
|
1015
1019
|
var suspenseCache = internal.getSuspenseCache(client);
|
|
1016
1020
|
var watchQueryOptions = useWatchQueryOptions({ client: client, query: query, options: options });
|
|
@@ -1127,11 +1131,11 @@ function useLoadableQuery(query, options) {
|
|
|
1127
1131
|
|
|
1128
1132
|
function useQueryRefHandlers(queryRef) {
|
|
1129
1133
|
var unwrapped = internal.unwrapQueryRef(queryRef);
|
|
1130
|
-
return wrapHook("useQueryRefHandlers",
|
|
1134
|
+
return wrapHook("useQueryRefHandlers", useQueryRefHandlers_, unwrapped ?
|
|
1131
1135
|
unwrapped["observable"]
|
|
1132
1136
|
: useApolloClient())(queryRef);
|
|
1133
1137
|
}
|
|
1134
|
-
function
|
|
1138
|
+
function useQueryRefHandlers_(queryRef) {
|
|
1135
1139
|
internal.assertWrappedQueryRef(queryRef);
|
|
1136
1140
|
var _a = React__namespace.useState(queryRef), previousQueryRef = _a[0], setPreviousQueryRef = _a[1];
|
|
1137
1141
|
var _b = React__namespace.useState(queryRef), wrappedQueryRef = _b[0], setWrappedQueryRef = _b[1];
|
|
@@ -1162,11 +1166,11 @@ function _useQueryRefHandlers(queryRef) {
|
|
|
1162
1166
|
|
|
1163
1167
|
function useReadQuery(queryRef) {
|
|
1164
1168
|
var unwrapped = internal.unwrapQueryRef(queryRef);
|
|
1165
|
-
return wrapHook("useReadQuery",
|
|
1169
|
+
return wrapHook("useReadQuery", useReadQuery_, unwrapped ?
|
|
1166
1170
|
unwrapped["observable"]
|
|
1167
1171
|
: useApolloClient())(queryRef);
|
|
1168
1172
|
}
|
|
1169
|
-
function
|
|
1173
|
+
function useReadQuery_(queryRef) {
|
|
1170
1174
|
internal.assertWrappedQueryRef(queryRef);
|
|
1171
1175
|
var internalQueryRef = React__namespace.useMemo(function () { return internal.unwrapQueryRef(queryRef); }, [queryRef]);
|
|
1172
1176
|
var getPromise = React__namespace.useCallback(function () { return internal.getWrappedPromise(queryRef); }, [queryRef]);
|