@apollo/client 3.13.8 → 3.14.0-alpha.0
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/.changeset/chilled-cameras-scream.md +5 -0
- package/.changeset/great-suns-cover.md +5 -0
- package/.changeset/perfect-donuts-roll.md +5 -0
- package/.changeset/popular-waves-drop.md +5 -0
- package/.changeset/pre.json +16 -0
- package/.changeset/shy-dragons-tease.md +5 -0
- package/.changeset/smooth-countries-cough.md +5 -0
- package/.changeset/spotty-walls-repair.md +5 -0
- package/CHANGELOG.md +20 -0
- package/README.md +80 -31
- package/apollo-client.cjs +354 -132
- package/apollo-client.cjs.map +1 -1
- package/apollo-client.min.cjs +1 -1
- package/cache/cache.cjs +78 -21
- package/cache/cache.cjs.map +1 -1
- package/cache/cache.cjs.native.js +78 -21
- package/cache/core/cache.js +27 -4
- package/cache/core/cache.js.map +1 -1
- package/cache/core/types/Cache.d.ts +4 -4
- package/cache/core/types/Cache.js.map +1 -1
- package/cache/core/types/DataProxy.d.ts +2 -2
- package/cache/inmemory/inMemoryCache.js +15 -4
- package/cache/inmemory/inMemoryCache.js.map +1 -1
- package/cache/inmemory/policies.js +18 -13
- package/cache/inmemory/policies.js.map +1 -1
- package/cache/inmemory/readFromStore.d.ts +7 -0
- package/cache/inmemory/readFromStore.js.map +1 -1
- package/cache/inmemory/types.d.ts +14 -3
- package/cache/inmemory/types.js.map +1 -1
- package/core/ApolloClient.d.ts +191 -2
- package/core/ApolloClient.js +93 -7
- package/core/ApolloClient.js.map +1 -1
- package/core/LocalState.js +2 -2
- package/core/ObservableQuery.js +10 -6
- package/core/ObservableQuery.js.map +1 -1
- package/core/QueryInfo.js +8 -2
- package/core/QueryInfo.js.map +1 -1
- package/core/QueryManager.js +15 -12
- package/core/QueryManager.js.map +1 -1
- package/core/core.cjs +93 -30
- package/core/core.cjs.map +1 -1
- package/core/core.cjs.native.js +93 -30
- package/core/watchQueryOptions.d.ts +2 -2
- package/dev/dev.cjs +144 -84
- package/dev/dev.cjs.map +1 -1
- package/dev/dev.cjs.native.js +144 -84
- package/invariantErrorCodes.js +158 -83
- package/link/core/ApolloLink.js +2 -2
- package/link/core/core.cjs +2 -2
- package/link/core/core.cjs.map +1 -1
- package/link/core/core.cjs.native.js +2 -2
- package/link/http/checkFetcher.js +1 -1
- package/link/http/createHttpLink.js +1 -1
- package/link/http/http.cjs +3 -3
- package/link/http/http.cjs.map +1 -1
- package/link/http/http.cjs.native.js +3 -3
- package/link/http/serializeFetchParameter.js +1 -1
- package/link/persisted-queries/index.js +2 -2
- package/link/persisted-queries/persisted-queries.cjs +2 -2
- package/link/persisted-queries/persisted-queries.cjs.map +1 -1
- package/link/persisted-queries/persisted-queries.cjs.native.js +2 -2
- package/link/utils/toPromise.js +1 -1
- package/link/utils/utils.cjs +2 -2
- package/link/utils/utils.cjs.map +1 -1
- package/link/utils/utils.cjs.native.js +2 -2
- package/link/utils/validateOperation.js +1 -1
- package/masking/maskDefinition.js +2 -2
- package/masking/maskFragment.js +2 -2
- package/masking/maskOperation.js +1 -1
- package/masking/masking.cjs +6 -6
- package/masking/masking.cjs.map +1 -1
- package/masking/masking.cjs.native.js +6 -6
- package/masking/utils.js +1 -1
- package/package.json +1 -1
- package/react/components/Mutation.js +5 -0
- package/react/components/Mutation.js.map +1 -1
- package/react/components/Query.js +5 -0
- package/react/components/Query.js.map +1 -1
- package/react/components/Subscription.js +5 -0
- package/react/components/Subscription.js.map +1 -1
- package/react/components/components.cjs +34 -0
- package/react/components/components.cjs.map +1 -1
- package/react/components/components.cjs.native.js +34 -0
- package/react/context/ApolloConsumer.js +1 -1
- package/react/context/ApolloContext.js +7 -2
- package/react/context/ApolloContext.js.map +1 -1
- package/react/context/ApolloProvider.js +1 -1
- package/react/context/context.cjs +9 -4
- package/react/context/context.cjs.map +1 -1
- package/react/context/context.cjs.native.js +9 -4
- package/react/hoc/graphql.js +17 -4
- package/react/hoc/graphql.js.map +1 -1
- package/react/hoc/hoc-utils.js +1 -1
- package/react/hoc/hoc.cjs +55 -9
- package/react/hoc/hoc.cjs.map +1 -1
- package/react/hoc/hoc.cjs.native.js +55 -9
- package/react/hoc/mutation-hoc.js +8 -1
- package/react/hoc/mutation-hoc.js.map +1 -1
- package/react/hoc/query-hoc.js +8 -1
- package/react/hoc/query-hoc.js.map +1 -1
- package/react/hoc/subscription-hoc.js +8 -1
- package/react/hoc/subscription-hoc.js.map +1 -1
- package/react/hoc/withApollo.js +1 -1
- package/react/hooks/hooks.cjs +264 -31
- package/react/hooks/hooks.cjs.map +1 -1
- package/react/hooks/hooks.cjs.native.js +264 -31
- package/react/hooks/internal/index.d.ts +2 -0
- package/react/hooks/internal/index.js +2 -0
- package/react/hooks/internal/index.js.map +1 -1
- package/react/hooks/internal/useWarnRemoved.d.ts +2 -0
- package/react/hooks/internal/useWarnRemoved.js +14 -0
- package/react/hooks/internal/useWarnRemoved.js.map +1 -0
- package/react/hooks/internal/useWarnRemovedOption.d.ts +2 -0
- package/react/hooks/internal/useWarnRemovedOption.js +14 -0
- package/react/hooks/internal/useWarnRemovedOption.js.map +1 -0
- package/react/hooks/useApolloClient.js +1 -1
- package/react/hooks/useBackgroundQuery.js +11 -3
- package/react/hooks/useBackgroundQuery.js.map +1 -1
- package/react/hooks/useFragment.js +30 -21
- package/react/hooks/useFragment.js.map +1 -1
- package/react/hooks/useLazyQuery.js +65 -0
- package/react/hooks/useLazyQuery.js.map +1 -1
- package/react/hooks/useLoadableQuery.js +12 -5
- package/react/hooks/useLoadableQuery.js.map +1 -1
- package/react/hooks/useMutation.js +5 -1
- package/react/hooks/useMutation.js.map +1 -1
- package/react/hooks/useQuery.d.ts +2 -2
- package/react/hooks/useQuery.js +25 -7
- package/react/hooks/useQuery.js.map +1 -1
- package/react/hooks/useSubscription.js +3 -3
- package/react/hooks/useSubscription.js.map +1 -1
- package/react/hooks/useSuspenseQuery.js +12 -6
- package/react/hooks/useSuspenseQuery.js.map +1 -1
- package/react/hooks/useSyncExternalStore.js +1 -1
- package/react/internal/cache/QueryReference.d.ts +16 -0
- package/react/internal/cache/QueryReference.js +1 -1
- package/react/internal/cache/QueryReference.js.map +1 -1
- package/react/internal/internal.cjs +2 -2
- package/react/internal/internal.cjs.map +1 -1
- package/react/internal/internal.cjs.native.js +2 -2
- package/react/parser/index.d.ts +7 -0
- package/react/parser/index.js +17 -7
- package/react/parser/index.js.map +1 -1
- package/react/parser/parser.cjs +28 -7
- package/react/parser/parser.cjs.map +1 -1
- package/react/parser/parser.cjs.native.js +28 -7
- package/react/query-preloader/createQueryPreloader.d.ts +2 -1
- package/react/query-preloader/createQueryPreloader.js +14 -5
- package/react/query-preloader/createQueryPreloader.js.map +1 -1
- package/react/react.cjs +40 -6
- package/react/react.cjs.map +1 -1
- package/react/react.cjs.native.js +40 -6
- package/react/types/types.d.ts +303 -9
- package/react/types/types.documentation.d.ts +2 -3
- package/react/types/types.documentation.js.map +1 -1
- package/react/types/types.js.map +1 -1
- package/testing/core/core.cjs +2 -2
- package/testing/core/core.cjs.map +1 -1
- package/testing/core/core.cjs.native.js +2 -2
- package/testing/core/mocking/mockLink.js +2 -2
- package/testing/react/MockedProvider.d.ts +27 -1
- package/testing/react/MockedProvider.js +16 -10
- package/testing/react/MockedProvider.js.map +1 -1
- package/testing/testing.cjs +42 -11
- package/testing/testing.cjs.map +1 -1
- package/testing/testing.cjs.native.js +42 -11
- package/utilities/deprecation/index.d.ts +11 -0
- package/utilities/deprecation/index.js +28 -0
- package/utilities/deprecation/index.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/graphql/DocumentTransform.js +1 -1
- package/utilities/graphql/directives.js +7 -7
- package/utilities/graphql/fragments.js +3 -3
- package/utilities/graphql/getFromAST.js +8 -8
- package/utilities/graphql/storeUtils.js +1 -1
- package/utilities/graphql/transform.js +2 -2
- package/utilities/utilities.cjs +22 -22
- package/utilities/utilities.cjs.map +1 -1
- package/utilities/utilities.cjs.native.js +22 -22
- package/version.js +1 -1
|
@@ -45,7 +45,7 @@ var createPersistedQueryLink = function (options) {
|
|
|
45
45
|
}
|
|
46
46
|
globals.invariant(options &&
|
|
47
47
|
(typeof options.sha256 === "function" ||
|
|
48
|
-
typeof options.generateHash === "function"),
|
|
48
|
+
typeof options.generateHash === "function"), 44);
|
|
49
49
|
var _a = utilities.compact(defaultOptions, options), sha256 = _a.sha256,
|
|
50
50
|
_b = _a.generateHash,
|
|
51
51
|
generateHash = _b === void 0 ? function (query) {
|
|
@@ -69,7 +69,7 @@ var createPersistedQueryLink = function (options) {
|
|
|
69
69
|
return hash;
|
|
70
70
|
}
|
|
71
71
|
return Object.assign(new core.ApolloLink(function (operation, forward) {
|
|
72
|
-
globals.invariant(forward,
|
|
72
|
+
globals.invariant(forward, 45);
|
|
73
73
|
var query = operation.query;
|
|
74
74
|
return new utilities.Observable(function (observer) {
|
|
75
75
|
var subscription;
|
package/link/utils/toPromise.js
CHANGED
package/link/utils/utils.cjs
CHANGED
|
@@ -19,7 +19,7 @@ function toPromise(observable) {
|
|
|
19
19
|
observable.subscribe({
|
|
20
20
|
next: function (data) {
|
|
21
21
|
if (completed) {
|
|
22
|
-
globalThis.__DEV__ !== false && globals.invariant.warn(
|
|
22
|
+
globalThis.__DEV__ !== false && globals.invariant.warn(46);
|
|
23
23
|
}
|
|
24
24
|
else {
|
|
25
25
|
completed = true;
|
|
@@ -62,7 +62,7 @@ function validateOperation(operation) {
|
|
|
62
62
|
for (var _i = 0, _a = Object.keys(operation); _i < _a.length; _i++) {
|
|
63
63
|
var key = _a[_i];
|
|
64
64
|
if (OPERATION_FIELDS.indexOf(key) < 0) {
|
|
65
|
-
throw globals.newInvariantError(
|
|
65
|
+
throw globals.newInvariantError(47, key);
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
return operation;
|
package/link/utils/utils.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.cjs","sources":["fromError.js","toPromise.js","fromPromise.js","throwServerError.js","validateOperation.js","createOperation.js","transformOperation.js","filterOperationVariables.js"],"sourcesContent":["import { Observable } from \"../../utilities/index.js\";\nexport function fromError(errorValue) {\n return new Observable(function (observer) {\n observer.error(errorValue);\n });\n}\n//# sourceMappingURL=fromError.js.map","import { invariant } from \"../../utilities/globals/index.js\";\nexport function toPromise(observable) {\n var completed = false;\n return new Promise(function (resolve, reject) {\n observable.subscribe({\n next: function (data) {\n if (completed) {\n globalThis.__DEV__ !== false && invariant.warn(
|
|
1
|
+
{"version":3,"file":"utils.cjs","sources":["fromError.js","toPromise.js","fromPromise.js","throwServerError.js","validateOperation.js","createOperation.js","transformOperation.js","filterOperationVariables.js"],"sourcesContent":["import { Observable } from \"../../utilities/index.js\";\nexport function fromError(errorValue) {\n return new Observable(function (observer) {\n observer.error(errorValue);\n });\n}\n//# sourceMappingURL=fromError.js.map","import { invariant } from \"../../utilities/globals/index.js\";\nexport function toPromise(observable) {\n var completed = false;\n return new Promise(function (resolve, reject) {\n observable.subscribe({\n next: function (data) {\n if (completed) {\n globalThis.__DEV__ !== false && invariant.warn(46);\n }\n else {\n completed = true;\n resolve(data);\n }\n },\n error: reject,\n });\n });\n}\n//# sourceMappingURL=toPromise.js.map","import { Observable } from \"../../utilities/index.js\";\nexport function fromPromise(promise) {\n return new Observable(function (observer) {\n promise\n .then(function (value) {\n observer.next(value);\n observer.complete();\n })\n .catch(observer.error.bind(observer));\n });\n}\n//# sourceMappingURL=fromPromise.js.map","export var throwServerError = function (response, result, message) {\n var error = new Error(message);\n error.name = \"ServerError\";\n error.response = response;\n error.statusCode = response.status;\n error.result = result;\n throw error;\n};\n//# sourceMappingURL=throwServerError.js.map","import { newInvariantError } from \"../../utilities/globals/index.js\";\nexport function validateOperation(operation) {\n var OPERATION_FIELDS = [\n \"query\",\n \"operationName\",\n \"variables\",\n \"extensions\",\n \"context\",\n ];\n for (var _i = 0, _a = Object.keys(operation); _i < _a.length; _i++) {\n var key = _a[_i];\n if (OPERATION_FIELDS.indexOf(key) < 0) {\n throw newInvariantError(47, key);\n }\n }\n return operation;\n}\n//# sourceMappingURL=validateOperation.js.map","import { __assign } from \"tslib\";\nexport function createOperation(starting, operation) {\n var context = __assign({}, starting);\n var setContext = function (next) {\n if (typeof next === \"function\") {\n context = __assign(__assign({}, context), next(context));\n }\n else {\n context = __assign(__assign({}, context), next);\n }\n };\n var getContext = function () { return (__assign({}, context)); };\n Object.defineProperty(operation, \"setContext\", {\n enumerable: false,\n value: setContext,\n });\n Object.defineProperty(operation, \"getContext\", {\n enumerable: false,\n value: getContext,\n });\n return operation;\n}\n//# sourceMappingURL=createOperation.js.map","import { getOperationName } from \"../../utilities/index.js\";\nexport function transformOperation(operation) {\n var transformedOperation = {\n variables: operation.variables || {},\n extensions: operation.extensions || {},\n operationName: operation.operationName,\n query: operation.query,\n };\n // Best guess at an operation name\n if (!transformedOperation.operationName) {\n transformedOperation.operationName =\n typeof transformedOperation.query !== \"string\" ?\n getOperationName(transformedOperation.query) || undefined\n : \"\";\n }\n return transformedOperation;\n}\n//# sourceMappingURL=transformOperation.js.map","import { __assign } from \"tslib\";\nimport { visit } from \"graphql\";\nexport function filterOperationVariables(variables, query) {\n var result = __assign({}, variables);\n var unusedNames = new Set(Object.keys(variables));\n visit(query, {\n Variable: function (node, _key, parent) {\n // A variable type definition at the top level of a query is not\n // enough to silence server-side errors about the variable being\n // unused, so variable definitions do not count as usage.\n // https://spec.graphql.org/draft/#sec-All-Variables-Used\n if (parent &&\n parent.kind !== \"VariableDefinition\") {\n unusedNames.delete(node.name.value);\n }\n },\n });\n unusedNames.forEach(function (name) {\n delete result[name];\n });\n return result;\n}\n//# sourceMappingURL=filterOperationVariables.js.map"],"names":["Observable","invariant","newInvariantError","__assign","getOperationName","visit"],"mappings":";;;;;;;;;AACO,SAAS,SAAS,CAAC,UAAU,EAAE;AACtC,IAAI,OAAO,IAAIA,oBAAU,CAAC,UAA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IAAI,WAAW,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;AACtD,IAAIE,aAAK,CAAC,KAAK,EAAE;AACjB,QAAQ,QAAQ,EAAE,UAAU,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE;AAKhD,YAAY,IAAI,MAAM;AACtB,gBAAgB,MAAM,CAAC,IAAI,KAAK,oBAAoB,EAAE;AACtD,gBAAgB,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACpD,aAAa;AACb,SAAS;AACT,KAAK,CAAC,CAAC;AACP,IAAI,WAAW,CAAC,OAAO,CAAC,UAAU,IAAI,EAAE;AACxC,QAAQ,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC;AAC5B,KAAK,CAAC,CAAC;AACP,IAAI,OAAO,MAAM,CAAC;AAClB;;;;;;;;;;;"}
|
|
@@ -19,7 +19,7 @@ function toPromise(observable) {
|
|
|
19
19
|
observable.subscribe({
|
|
20
20
|
next: function (data) {
|
|
21
21
|
if (completed) {
|
|
22
|
-
globalThis.__DEV__ !== false && globals.invariant.warn(
|
|
22
|
+
globalThis.__DEV__ !== false && globals.invariant.warn(46);
|
|
23
23
|
}
|
|
24
24
|
else {
|
|
25
25
|
completed = true;
|
|
@@ -62,7 +62,7 @@ function validateOperation(operation) {
|
|
|
62
62
|
for (var _i = 0, _a = Object.keys(operation); _i < _a.length; _i++) {
|
|
63
63
|
var key = _a[_i];
|
|
64
64
|
if (OPERATION_FIELDS.indexOf(key) < 0) {
|
|
65
|
-
throw globals.newInvariantError(
|
|
65
|
+
throw globals.newInvariantError(47, key);
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
return operation;
|
|
@@ -10,7 +10,7 @@ export function validateOperation(operation) {
|
|
|
10
10
|
for (var _i = 0, _a = Object.keys(operation); _i < _a.length; _i++) {
|
|
11
11
|
var key = _a[_i];
|
|
12
12
|
if (OPERATION_FIELDS.indexOf(key) < 0) {
|
|
13
|
-
throw newInvariantError(
|
|
13
|
+
throw newInvariantError(47, key);
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
return operation;
|
|
@@ -88,7 +88,7 @@ function maskSelectionSet(data, selectionSet, context, migration, path) {
|
|
|
88
88
|
var fragment = context.fragmentMap[fragmentName] ||
|
|
89
89
|
(context.fragmentMap[fragmentName] =
|
|
90
90
|
context.cache.lookupFragment(fragmentName));
|
|
91
|
-
invariant(fragment,
|
|
91
|
+
invariant(fragment, 48, fragmentName);
|
|
92
92
|
var mode = getFragmentMaskMode(selection);
|
|
93
93
|
if (mode !== "mask") {
|
|
94
94
|
value = maskSelectionSet(data, fragment.selectionSet, context, mode === "migrate", path);
|
|
@@ -114,7 +114,7 @@ function getAccessorWarningDescriptor(fieldName, value, path, operationName, ope
|
|
|
114
114
|
if (disableWarningsSlot.getValue()) {
|
|
115
115
|
return value;
|
|
116
116
|
}
|
|
117
|
-
globalThis.__DEV__ !== false && invariant.warn(
|
|
117
|
+
globalThis.__DEV__ !== false && invariant.warn(49, operationName ?
|
|
118
118
|
"".concat(operationType, " '").concat(operationName, "'")
|
|
119
119
|
: "anonymous ".concat(operationType), "".concat(path, ".").concat(fieldName).replace(/^\./, ""));
|
|
120
120
|
getValue = function () { return value; };
|
package/masking/maskFragment.js
CHANGED
|
@@ -16,11 +16,11 @@ export function maskFragment(data, document, cache, fragmentName) {
|
|
|
16
16
|
return node.kind === Kind.FRAGMENT_DEFINITION;
|
|
17
17
|
});
|
|
18
18
|
if (typeof fragmentName === "undefined") {
|
|
19
|
-
invariant(fragments.length === 1,
|
|
19
|
+
invariant(fragments.length === 1, 50, fragments.length);
|
|
20
20
|
fragmentName = fragments[0].name.value;
|
|
21
21
|
}
|
|
22
22
|
var fragment = fragments.find(function (fragment) { return fragment.name.value === fragmentName; });
|
|
23
|
-
invariant(!!fragment,
|
|
23
|
+
invariant(!!fragment, 51, fragmentName);
|
|
24
24
|
if (data == null) {
|
|
25
25
|
// Maintain the original `null` or `undefined` value
|
|
26
26
|
return data;
|
package/masking/maskOperation.js
CHANGED
|
@@ -12,7 +12,7 @@ export function maskOperation(data, document, cache) {
|
|
|
12
12
|
return data;
|
|
13
13
|
}
|
|
14
14
|
var definition = getOperationDefinition(document);
|
|
15
|
-
invariant(definition,
|
|
15
|
+
invariant(definition, 52);
|
|
16
16
|
if (data == null) {
|
|
17
17
|
// Maintain the original `null` or `undefined` value
|
|
18
18
|
return data;
|
package/masking/masking.cjs
CHANGED
|
@@ -19,7 +19,7 @@ var issuedWarning = false;
|
|
|
19
19
|
function warnOnImproperCacheImplementation() {
|
|
20
20
|
if (!issuedWarning) {
|
|
21
21
|
issuedWarning = true;
|
|
22
|
-
globalThis.__DEV__ !== false && globals.invariant.warn(
|
|
22
|
+
globalThis.__DEV__ !== false && globals.invariant.warn(53);
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
|
|
@@ -103,7 +103,7 @@ function maskSelectionSet(data, selectionSet, context, migration, path) {
|
|
|
103
103
|
var fragment = context.fragmentMap[fragmentName] ||
|
|
104
104
|
(context.fragmentMap[fragmentName] =
|
|
105
105
|
context.cache.lookupFragment(fragmentName));
|
|
106
|
-
globals.invariant(fragment,
|
|
106
|
+
globals.invariant(fragment, 48, fragmentName);
|
|
107
107
|
var mode = utilities.getFragmentMaskMode(selection);
|
|
108
108
|
if (mode !== "mask") {
|
|
109
109
|
value = maskSelectionSet(data, fragment.selectionSet, context, mode === "migrate", path);
|
|
@@ -126,7 +126,7 @@ function getAccessorWarningDescriptor(fieldName, value, path, operationName, ope
|
|
|
126
126
|
if (disableWarningsSlot.getValue()) {
|
|
127
127
|
return value;
|
|
128
128
|
}
|
|
129
|
-
globalThis.__DEV__ !== false && globals.invariant.warn(
|
|
129
|
+
globalThis.__DEV__ !== false && globals.invariant.warn(49, operationName ?
|
|
130
130
|
"".concat(operationType, " '").concat(operationName, "'")
|
|
131
131
|
: "anonymous ".concat(operationType), "".concat(path, ".").concat(fieldName).replace(/^\./, ""));
|
|
132
132
|
getValue = function () { return value; };
|
|
@@ -155,11 +155,11 @@ function maskFragment(data, document, cache, fragmentName) {
|
|
|
155
155
|
return node.kind === graphql.Kind.FRAGMENT_DEFINITION;
|
|
156
156
|
});
|
|
157
157
|
if (typeof fragmentName === "undefined") {
|
|
158
|
-
globals.invariant(fragments.length === 1,
|
|
158
|
+
globals.invariant(fragments.length === 1, 50, fragments.length);
|
|
159
159
|
fragmentName = fragments[0].name.value;
|
|
160
160
|
}
|
|
161
161
|
var fragment = fragments.find(function (fragment) { return fragment.name.value === fragmentName; });
|
|
162
|
-
globals.invariant(!!fragment,
|
|
162
|
+
globals.invariant(!!fragment, 51, fragmentName);
|
|
163
163
|
if (data == null) {
|
|
164
164
|
return data;
|
|
165
165
|
}
|
|
@@ -185,7 +185,7 @@ function maskOperation(data, document, cache) {
|
|
|
185
185
|
return data;
|
|
186
186
|
}
|
|
187
187
|
var definition = utilities.getOperationDefinition(document);
|
|
188
|
-
globals.invariant(definition,
|
|
188
|
+
globals.invariant(definition, 52);
|
|
189
189
|
if (data == null) {
|
|
190
190
|
return data;
|
|
191
191
|
}
|
package/masking/masking.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"masking.cjs","sources":["utils.js","maskDefinition.js","maskFragment.js","maskOperation.js"],"sourcesContent":["import { Slot } from \"optimism\";\nimport { invariant } from \"../utilities/globals/index.js\";\nimport { canUseWeakMap, canUseWeakSet } from \"../utilities/index.js\";\nexport var MapImpl = canUseWeakMap ? WeakMap : Map;\nexport var SetImpl = canUseWeakSet ? WeakSet : Set;\n// Contextual slot that allows us to disable accessor warnings on fields when in\n// migrate mode.\n/** @internal */\nexport var disableWarningsSlot = new Slot();\nvar issuedWarning = false;\nexport function warnOnImproperCacheImplementation() {\n if (!issuedWarning) {\n issuedWarning = true;\n globalThis.__DEV__ !== false && invariant.warn(52);\n }\n}\n//# sourceMappingURL=utils.js.map","import { Kind } from \"graphql\";\nimport { getFragmentMaskMode, maybeDeepFreeze, resultKeyNameFromField, } from \"../utilities/index.js\";\nimport { disableWarningsSlot } from \"./utils.js\";\nimport { invariant } from \"../utilities/globals/index.js\";\nexport function maskDefinition(data, selectionSet, context) {\n return disableWarningsSlot.withValue(true, function () {\n var masked = maskSelectionSet(data, selectionSet, context, false);\n if (Object.isFrozen(data)) {\n maybeDeepFreeze(masked);\n }\n return masked;\n });\n}\nfunction getMutableTarget(data, mutableTargets) {\n if (mutableTargets.has(data)) {\n return mutableTargets.get(data);\n }\n var mutableTarget = Array.isArray(data) ? [] : Object.create(null);\n mutableTargets.set(data, mutableTarget);\n return mutableTarget;\n}\nfunction maskSelectionSet(data, selectionSet, context, migration, path) {\n var _a;\n var knownChanged = context.knownChanged;\n var memo = getMutableTarget(data, context.mutableTargets);\n if (Array.isArray(data)) {\n for (var _i = 0, _b = Array.from(data.entries()); _i < _b.length; _i++) {\n var _c = _b[_i], index = _c[0], item = _c[1];\n if (item === null) {\n memo[index] = null;\n continue;\n }\n var masked = maskSelectionSet(item, selectionSet, context, migration, globalThis.__DEV__ !== false ? \"\".concat(path || \"\", \"[\").concat(index, \"]\") : void 0);\n if (knownChanged.has(masked)) {\n knownChanged.add(memo);\n }\n memo[index] = masked;\n }\n return knownChanged.has(memo) ? memo : data;\n }\n for (var _d = 0, _e = selectionSet.selections; _d < _e.length; _d++) {\n var selection = _e[_d];\n var value = void 0;\n // we later want to add acessor warnings to the final result\n // so we need a new object to add the accessor warning to\n if (migration) {\n knownChanged.add(memo);\n }\n if (selection.kind === Kind.FIELD) {\n var keyName = resultKeyNameFromField(selection);\n var childSelectionSet = selection.selectionSet;\n value = memo[keyName] || data[keyName];\n if (value === void 0) {\n continue;\n }\n if (childSelectionSet && value !== null) {\n var masked = maskSelectionSet(data[keyName], childSelectionSet, context, migration, globalThis.__DEV__ !== false ? \"\".concat(path || \"\", \".\").concat(keyName) : void 0);\n if (knownChanged.has(masked)) {\n value = masked;\n }\n }\n if (!(globalThis.__DEV__ !== false)) {\n memo[keyName] = value;\n }\n if (globalThis.__DEV__ !== false) {\n if (migration &&\n keyName !== \"__typename\" &&\n // either the field is not present in the memo object\n // or it has a `get` descriptor, not a `value` descriptor\n // => it is a warning accessor and we can overwrite it\n // with another accessor\n !((_a = Object.getOwnPropertyDescriptor(memo, keyName)) === null || _a === void 0 ? void 0 : _a.value)) {\n Object.defineProperty(memo, keyName, getAccessorWarningDescriptor(keyName, value, path || \"\", context.operationName, context.operationType));\n }\n else {\n delete memo[keyName];\n memo[keyName] = value;\n }\n }\n }\n if (selection.kind === Kind.INLINE_FRAGMENT &&\n (!selection.typeCondition ||\n context.cache.fragmentMatches(selection, data.__typename))) {\n value = maskSelectionSet(data, selection.selectionSet, context, migration, path);\n }\n if (selection.kind === Kind.FRAGMENT_SPREAD) {\n var fragmentName = selection.name.value;\n var fragment = context.fragmentMap[fragmentName] ||\n (context.fragmentMap[fragmentName] =\n context.cache.lookupFragment(fragmentName));\n invariant(fragment, 47, fragmentName);\n var mode = getFragmentMaskMode(selection);\n if (mode !== \"mask\") {\n value = maskSelectionSet(data, fragment.selectionSet, context, mode === \"migrate\", path);\n }\n }\n if (knownChanged.has(value)) {\n knownChanged.add(memo);\n }\n }\n if (\"__typename\" in data && !(\"__typename\" in memo)) {\n memo.__typename = data.__typename;\n }\n // This check prevents cases where masked fields may accidentally be\n // returned as part of this object when the fragment also selects\n // additional fields from the same child selection.\n if (Object.keys(memo).length !== Object.keys(data).length) {\n knownChanged.add(memo);\n }\n return knownChanged.has(memo) ? memo : data;\n}\nfunction getAccessorWarningDescriptor(fieldName, value, path, operationName, operationType) {\n var getValue = function () {\n if (disableWarningsSlot.getValue()) {\n return value;\n }\n globalThis.__DEV__ !== false && invariant.warn(48, operationName ?\n \"\".concat(operationType, \" '\").concat(operationName, \"'\")\n : \"anonymous \".concat(operationType), \"\".concat(path, \".\").concat(fieldName).replace(/^\\./, \"\"));\n getValue = function () { return value; };\n return value;\n };\n return {\n get: function () {\n return getValue();\n },\n set: function (newValue) {\n getValue = function () { return newValue; };\n },\n enumerable: true,\n configurable: true,\n };\n}\n//# sourceMappingURL=maskDefinition.js.map","import { Kind } from \"graphql\";\nimport { MapImpl, SetImpl, warnOnImproperCacheImplementation, } from \"./utils.js\";\nimport { invariant } from \"../utilities/globals/index.js\";\nimport equal from \"@wry/equality\";\nimport { maskDefinition } from \"./maskDefinition.js\";\nimport { createFragmentMap, getFragmentDefinitions, } from \"../utilities/index.js\";\n/** @internal */\nexport function maskFragment(data, document, cache, fragmentName) {\n if (!cache.fragmentMatches) {\n if (globalThis.__DEV__ !== false) {\n warnOnImproperCacheImplementation();\n }\n return data;\n }\n var fragments = document.definitions.filter(function (node) {\n return node.kind === Kind.FRAGMENT_DEFINITION;\n });\n if (typeof fragmentName === \"undefined\") {\n invariant(fragments.length === 1, 49, fragments.length);\n fragmentName = fragments[0].name.value;\n }\n var fragment = fragments.find(function (fragment) { return fragment.name.value === fragmentName; });\n invariant(!!fragment, 50, fragmentName);\n if (data == null) {\n // Maintain the original `null` or `undefined` value\n return data;\n }\n if (equal(data, {})) {\n // Return early and skip the masking algorithm if we don't have any data\n // yet. This can happen when cache.diff returns an empty object which is\n // used from watchFragment.\n return data;\n }\n return maskDefinition(data, fragment.selectionSet, {\n operationType: \"fragment\",\n operationName: fragment.name.value,\n fragmentMap: createFragmentMap(getFragmentDefinitions(document)),\n cache: cache,\n mutableTargets: new MapImpl(),\n knownChanged: new SetImpl(),\n });\n}\n//# sourceMappingURL=maskFragment.js.map","import { invariant } from \"../utilities/globals/index.js\";\nimport { createFragmentMap, getFragmentDefinitions, getOperationDefinition, } from \"../utilities/index.js\";\nimport { maskDefinition } from \"./maskDefinition.js\";\nimport { MapImpl, SetImpl, warnOnImproperCacheImplementation, } from \"./utils.js\";\n/** @internal */\nexport function maskOperation(data, document, cache) {\n var _a;\n if (!cache.fragmentMatches) {\n if (globalThis.__DEV__ !== false) {\n warnOnImproperCacheImplementation();\n }\n return data;\n }\n var definition = getOperationDefinition(document);\n invariant(definition, 51);\n if (data == null) {\n // Maintain the original `null` or `undefined` value\n return data;\n }\n return maskDefinition(data, definition.selectionSet, {\n operationType: definition.operation,\n operationName: (_a = definition.name) === null || _a === void 0 ? void 0 : _a.value,\n fragmentMap: createFragmentMap(getFragmentDefinitions(document)),\n cache: cache,\n mutableTargets: new MapImpl(),\n knownChanged: new SetImpl(),\n });\n}\n//# sourceMappingURL=maskOperation.js.map"],"names":["canUseWeakMap","canUseWeakSet","Slot","invariant","maybeDeepFreeze","Kind","resultKeyNameFromField","getFragmentMaskMode","equal","createFragmentMap","getFragmentDefinitions","getOperationDefinition"],"mappings":";;;;;;;;;;;;;;AAGO,IAAI,OAAO,GAAGA,uBAAa,GAAG,OAAO,GAAG,GAAG,CAAC;AAC5C,IAAI,OAAO,GAAGC,uBAAa,GAAG,OAAO,GAAG,GAAG,CAAC;AAIzC,IAAC,mBAAmB,GAAG,IAAIC,aAAI,GAAG;AAC5C,IAAI,aAAa,GAAG,KAAK,CAAC;AACnB,SAAS,iCAAiC,GAAG;AACpD,IAAI,IAAI,CAAC,aAAa,EAAE;AACxB,QAAQ,aAAa,GAAG,IAAI,CAAC;AAC7B,QAAQ,UAAU,CAAC,OAAO,KAAK,KAAK,IAAIC,iBAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC3D,KAAK;AACL;;ACXO,SAAS,cAAc,CAAC,IAAI,EAAE,YAAY,EAAE,OAAO,EAAE;AAC5D,IAAI,OAAO,mBAAmB,CAAC,SAAS,CAAC,IAAI,EAAE,YAAY;AAC3D,QAAQ,IAAI,MAAM,GAAG,gBAAgB,CAAC,IAAI,EAAE,YAAY,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AAC1E,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;AACnC,YAAYC,yBAAe,CAAC,MAAM,CAAC,CAAC;AACpC,SAAS;AACT,QAAQ,OAAO,MAAM,C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AAC,QAAQ,CAAC,CAAC;AACxE,QAAQ,KAAK,EAAE,KAAK;AACpB,QAAQ,cAAc,EAAE,IAAI,OAAO,EAAE;AACrC,QAAQ,YAAY,EAAE,IAAI,OAAO,EAAE;AACnC,KAAK,CAAC,CAAC;AACP;;;;;;"}
|
|
1
|
+
{"version":3,"file":"masking.cjs","sources":["utils.js","maskDefinition.js","maskFragment.js","maskOperation.js"],"sourcesContent":["import { Slot } from \"optimism\";\nimport { invariant } from \"../utilities/globals/index.js\";\nimport { canUseWeakMap, canUseWeakSet } from \"../utilities/index.js\";\nexport var MapImpl = canUseWeakMap ? WeakMap : Map;\nexport var SetImpl = canUseWeakSet ? WeakSet : Set;\n// Contextual slot that allows us to disable accessor warnings on fields when in\n// migrate mode.\n/** @internal */\nexport var disableWarningsSlot = new Slot();\nvar issuedWarning = false;\nexport function warnOnImproperCacheImplementation() {\n if (!issuedWarning) {\n issuedWarning = true;\n globalThis.__DEV__ !== false && invariant.warn(53);\n }\n}\n//# sourceMappingURL=utils.js.map","import { Kind } from \"graphql\";\nimport { getFragmentMaskMode, maybeDeepFreeze, resultKeyNameFromField, } from \"../utilities/index.js\";\nimport { disableWarningsSlot } from \"./utils.js\";\nimport { invariant } from \"../utilities/globals/index.js\";\nexport function maskDefinition(data, selectionSet, context) {\n return disableWarningsSlot.withValue(true, function () {\n var masked = maskSelectionSet(data, selectionSet, context, false);\n if (Object.isFrozen(data)) {\n maybeDeepFreeze(masked);\n }\n return masked;\n });\n}\nfunction getMutableTarget(data, mutableTargets) {\n if (mutableTargets.has(data)) {\n return mutableTargets.get(data);\n }\n var mutableTarget = Array.isArray(data) ? [] : Object.create(null);\n mutableTargets.set(data, mutableTarget);\n return mutableTarget;\n}\nfunction maskSelectionSet(data, selectionSet, context, migration, path) {\n var _a;\n var knownChanged = context.knownChanged;\n var memo = getMutableTarget(data, context.mutableTargets);\n if (Array.isArray(data)) {\n for (var _i = 0, _b = Array.from(data.entries()); _i < _b.length; _i++) {\n var _c = _b[_i], index = _c[0], item = _c[1];\n if (item === null) {\n memo[index] = null;\n continue;\n }\n var masked = maskSelectionSet(item, selectionSet, context, migration, globalThis.__DEV__ !== false ? \"\".concat(path || \"\", \"[\").concat(index, \"]\") : void 0);\n if (knownChanged.has(masked)) {\n knownChanged.add(memo);\n }\n memo[index] = masked;\n }\n return knownChanged.has(memo) ? memo : data;\n }\n for (var _d = 0, _e = selectionSet.selections; _d < _e.length; _d++) {\n var selection = _e[_d];\n var value = void 0;\n // we later want to add acessor warnings to the final result\n // so we need a new object to add the accessor warning to\n if (migration) {\n knownChanged.add(memo);\n }\n if (selection.kind === Kind.FIELD) {\n var keyName = resultKeyNameFromField(selection);\n var childSelectionSet = selection.selectionSet;\n value = memo[keyName] || data[keyName];\n if (value === void 0) {\n continue;\n }\n if (childSelectionSet && value !== null) {\n var masked = maskSelectionSet(data[keyName], childSelectionSet, context, migration, globalThis.__DEV__ !== false ? \"\".concat(path || \"\", \".\").concat(keyName) : void 0);\n if (knownChanged.has(masked)) {\n value = masked;\n }\n }\n if (!(globalThis.__DEV__ !== false)) {\n memo[keyName] = value;\n }\n if (globalThis.__DEV__ !== false) {\n if (migration &&\n keyName !== \"__typename\" &&\n // either the field is not present in the memo object\n // or it has a `get` descriptor, not a `value` descriptor\n // => it is a warning accessor and we can overwrite it\n // with another accessor\n !((_a = Object.getOwnPropertyDescriptor(memo, keyName)) === null || _a === void 0 ? void 0 : _a.value)) {\n Object.defineProperty(memo, keyName, getAccessorWarningDescriptor(keyName, value, path || \"\", context.operationName, context.operationType));\n }\n else {\n delete memo[keyName];\n memo[keyName] = value;\n }\n }\n }\n if (selection.kind === Kind.INLINE_FRAGMENT &&\n (!selection.typeCondition ||\n context.cache.fragmentMatches(selection, data.__typename))) {\n value = maskSelectionSet(data, selection.selectionSet, context, migration, path);\n }\n if (selection.kind === Kind.FRAGMENT_SPREAD) {\n var fragmentName = selection.name.value;\n var fragment = context.fragmentMap[fragmentName] ||\n (context.fragmentMap[fragmentName] =\n context.cache.lookupFragment(fragmentName));\n invariant(fragment, 48, fragmentName);\n var mode = getFragmentMaskMode(selection);\n if (mode !== \"mask\") {\n value = maskSelectionSet(data, fragment.selectionSet, context, mode === \"migrate\", path);\n }\n }\n if (knownChanged.has(value)) {\n knownChanged.add(memo);\n }\n }\n if (\"__typename\" in data && !(\"__typename\" in memo)) {\n memo.__typename = data.__typename;\n }\n // This check prevents cases where masked fields may accidentally be\n // returned as part of this object when the fragment also selects\n // additional fields from the same child selection.\n if (Object.keys(memo).length !== Object.keys(data).length) {\n knownChanged.add(memo);\n }\n return knownChanged.has(memo) ? memo : data;\n}\nfunction getAccessorWarningDescriptor(fieldName, value, path, operationName, operationType) {\n var getValue = function () {\n if (disableWarningsSlot.getValue()) {\n return value;\n }\n globalThis.__DEV__ !== false && invariant.warn(49, operationName ?\n \"\".concat(operationType, \" '\").concat(operationName, \"'\")\n : \"anonymous \".concat(operationType), \"\".concat(path, \".\").concat(fieldName).replace(/^\\./, \"\"));\n getValue = function () { return value; };\n return value;\n };\n return {\n get: function () {\n return getValue();\n },\n set: function (newValue) {\n getValue = function () { return newValue; };\n },\n enumerable: true,\n configurable: true,\n };\n}\n//# sourceMappingURL=maskDefinition.js.map","import { Kind } from \"graphql\";\nimport { MapImpl, SetImpl, warnOnImproperCacheImplementation, } from \"./utils.js\";\nimport { invariant } from \"../utilities/globals/index.js\";\nimport equal from \"@wry/equality\";\nimport { maskDefinition } from \"./maskDefinition.js\";\nimport { createFragmentMap, getFragmentDefinitions, } from \"../utilities/index.js\";\n/** @internal */\nexport function maskFragment(data, document, cache, fragmentName) {\n if (!cache.fragmentMatches) {\n if (globalThis.__DEV__ !== false) {\n warnOnImproperCacheImplementation();\n }\n return data;\n }\n var fragments = document.definitions.filter(function (node) {\n return node.kind === Kind.FRAGMENT_DEFINITION;\n });\n if (typeof fragmentName === \"undefined\") {\n invariant(fragments.length === 1, 50, fragments.length);\n fragmentName = fragments[0].name.value;\n }\n var fragment = fragments.find(function (fragment) { return fragment.name.value === fragmentName; });\n invariant(!!fragment, 51, fragmentName);\n if (data == null) {\n // Maintain the original `null` or `undefined` value\n return data;\n }\n if (equal(data, {})) {\n // Return early and skip the masking algorithm if we don't have any data\n // yet. This can happen when cache.diff returns an empty object which is\n // used from watchFragment.\n return data;\n }\n return maskDefinition(data, fragment.selectionSet, {\n operationType: \"fragment\",\n operationName: fragment.name.value,\n fragmentMap: createFragmentMap(getFragmentDefinitions(document)),\n cache: cache,\n mutableTargets: new MapImpl(),\n knownChanged: new SetImpl(),\n });\n}\n//# sourceMappingURL=maskFragment.js.map","import { invariant } from \"../utilities/globals/index.js\";\nimport { createFragmentMap, getFragmentDefinitions, getOperationDefinition, } from \"../utilities/index.js\";\nimport { maskDefinition } from \"./maskDefinition.js\";\nimport { MapImpl, SetImpl, warnOnImproperCacheImplementation, } from \"./utils.js\";\n/** @internal */\nexport function maskOperation(data, document, cache) {\n var _a;\n if (!cache.fragmentMatches) {\n if (globalThis.__DEV__ !== false) {\n warnOnImproperCacheImplementation();\n }\n return data;\n }\n var definition = getOperationDefinition(document);\n invariant(definition, 52);\n if (data == null) {\n // Maintain the original `null` or `undefined` value\n return data;\n }\n return maskDefinition(data, definition.selectionSet, {\n operationType: definition.operation,\n operationName: (_a = definition.name) === null || _a === void 0 ? void 0 : _a.value,\n fragmentMap: createFragmentMap(getFragmentDefinitions(document)),\n cache: cache,\n mutableTargets: new MapImpl(),\n knownChanged: new SetImpl(),\n });\n}\n//# sourceMappingURL=maskOperation.js.map"],"names":["canUseWeakMap","canUseWeakSet","Slot","invariant","maybeDeepFreeze","Kind","resultKeyNameFromField","getFragmentMaskMode","equal","createFragmentMap","getFragmentDefinitions","getOperationDefinition"],"mappings":";;;;;;;;;;;;;;AAGO,IAAI,OAAO,GAAGA,uBAAa,GAAG,OAAO,GAAG,GAAG,CAAC;AAC5C,IAAI,OAAO,GAAGC,uBAAa,GAAG,OAAO,GAAG,GAAG,CAAC;AAIzC,IAAC,mBAAmB,GA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IAAI,UAAU,CAAC,OAAO,KAAK,KAAK,EAAE;AAC1C,YAAY,iCAAiC,EAAE,CAAC;AAChD,SAAS;AACT,QAAQ,OAAO,IAAI,CAAC;AACpB,KAAK;AACL,IAAI,IAAI,UAAU,GAAGC,gCAAsB,CAAC,QAAQ,CAAC,CAAC;AACtD,IAAIR,iBAAS,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;AAC9B,IAAI,IAAI,IAAI,IAAI,IAAI,EAAE;AAEtB,QAAQ,OAAO,IAAI,CAAC;AACpB,KAAK;AACL,IAAI,OAAO,cAAc,CAAC,IAAI,EAAE,UAAU,CAAC,YAAY,EAAE;AACzD,QAAQ,aAAa,EAAE,UAAU,CAAC,SAAS;AAC3C,QAAQ,aAAa,EAAE,CAAC,EAAE,GAAG,UAAU,CAAC,IAAI,MAAM,IAAI,IAAI,EAAE,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,KAAK;AAC3F,QAAQ,WAAW,EAAEM,2BAAiB,CAACC,gCAAsB,CAAC,QAAQ,CAAC,CAAC;AACxE,QAAQ,KAAK,EAAE,KAAK;AACpB,QAAQ,cAAc,EAAE,IAAI,OAAO,EAAE;AACrC,QAAQ,YAAY,EAAE,IAAI,OAAO,EAAE;AACnC,KAAK,CAAC,CAAC;AACP;;;;;;"}
|
|
@@ -19,7 +19,7 @@ var issuedWarning = false;
|
|
|
19
19
|
function warnOnImproperCacheImplementation() {
|
|
20
20
|
if (!issuedWarning) {
|
|
21
21
|
issuedWarning = true;
|
|
22
|
-
globalThis.__DEV__ !== false && globals.invariant.warn(
|
|
22
|
+
globalThis.__DEV__ !== false && globals.invariant.warn(53);
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
|
|
@@ -103,7 +103,7 @@ function maskSelectionSet(data, selectionSet, context, migration, path) {
|
|
|
103
103
|
var fragment = context.fragmentMap[fragmentName] ||
|
|
104
104
|
(context.fragmentMap[fragmentName] =
|
|
105
105
|
context.cache.lookupFragment(fragmentName));
|
|
106
|
-
globals.invariant(fragment,
|
|
106
|
+
globals.invariant(fragment, 48, fragmentName);
|
|
107
107
|
var mode = utilities.getFragmentMaskMode(selection);
|
|
108
108
|
if (mode !== "mask") {
|
|
109
109
|
value = maskSelectionSet(data, fragment.selectionSet, context, mode === "migrate", path);
|
|
@@ -126,7 +126,7 @@ function getAccessorWarningDescriptor(fieldName, value, path, operationName, ope
|
|
|
126
126
|
if (disableWarningsSlot.getValue()) {
|
|
127
127
|
return value;
|
|
128
128
|
}
|
|
129
|
-
globalThis.__DEV__ !== false && globals.invariant.warn(
|
|
129
|
+
globalThis.__DEV__ !== false && globals.invariant.warn(49, operationName ?
|
|
130
130
|
"".concat(operationType, " '").concat(operationName, "'")
|
|
131
131
|
: "anonymous ".concat(operationType), "".concat(path, ".").concat(fieldName).replace(/^\./, ""));
|
|
132
132
|
getValue = function () { return value; };
|
|
@@ -155,11 +155,11 @@ function maskFragment(data, document, cache, fragmentName) {
|
|
|
155
155
|
return node.kind === graphql.Kind.FRAGMENT_DEFINITION;
|
|
156
156
|
});
|
|
157
157
|
if (typeof fragmentName === "undefined") {
|
|
158
|
-
globals.invariant(fragments.length === 1,
|
|
158
|
+
globals.invariant(fragments.length === 1, 50, fragments.length);
|
|
159
159
|
fragmentName = fragments[0].name.value;
|
|
160
160
|
}
|
|
161
161
|
var fragment = fragments.find(function (fragment) { return fragment.name.value === fragmentName; });
|
|
162
|
-
globals.invariant(!!fragment,
|
|
162
|
+
globals.invariant(!!fragment, 51, fragmentName);
|
|
163
163
|
if (data == null) {
|
|
164
164
|
return data;
|
|
165
165
|
}
|
|
@@ -185,7 +185,7 @@ function maskOperation(data, document, cache) {
|
|
|
185
185
|
return data;
|
|
186
186
|
}
|
|
187
187
|
var definition = utilities.getOperationDefinition(document);
|
|
188
|
-
globals.invariant(definition,
|
|
188
|
+
globals.invariant(definition, 52);
|
|
189
189
|
if (data == null) {
|
|
190
190
|
return data;
|
|
191
191
|
}
|
package/masking/utils.js
CHANGED
|
@@ -11,7 +11,7 @@ var issuedWarning = false;
|
|
|
11
11
|
export function warnOnImproperCacheImplementation() {
|
|
12
12
|
if (!issuedWarning) {
|
|
13
13
|
issuedWarning = true;
|
|
14
|
-
globalThis.__DEV__ !== false && invariant.warn(
|
|
14
|
+
globalThis.__DEV__ !== false && invariant.warn(53);
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
//# sourceMappingURL=utils.js.map
|
package/package.json
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import * as PropTypes from "prop-types";
|
|
2
2
|
import { useMutation } from "../hooks/index.js";
|
|
3
|
+
import { useWarnRemoved } from "../hooks/internal/index.js";
|
|
4
|
+
import { invariant } from "../../utilities/globals/index.js";
|
|
3
5
|
/**
|
|
4
6
|
* @deprecated
|
|
5
7
|
* Official support for React Apollo render prop components ended in March 2020.
|
|
@@ -7,6 +9,9 @@ import { useMutation } from "../hooks/index.js";
|
|
|
7
9
|
* but it no longer receives feature updates or bug fixes.
|
|
8
10
|
*/
|
|
9
11
|
export function Mutation(props) {
|
|
12
|
+
useWarnRemoved("<Mutation />", function () {
|
|
13
|
+
globalThis.__DEV__ !== false && invariant.warn(54);
|
|
14
|
+
});
|
|
10
15
|
var _a = useMutation(props.mutation, props), runMutation = _a[0], result = _a[1];
|
|
11
16
|
return props.children ? props.children(runMutation, result) : null;
|
|
12
17
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Mutation.js","sourceRoot":"","sources":["../../../src/react/components/Mutation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,YAAY,CAAC;AAKxC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"Mutation.js","sourceRoot":"","sources":["../../../src/react/components/Mutation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,YAAY,CAAC;AAKxC,OAAO,EAAE,WAAW,EAAE,MA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import type * as ReactTypes from \"react\";\n\nimport type { OperationVariables } from \"../../core/index.js\";\nimport type { MutationComponentOptions } from \"./types.js\";\nimport { useMutation } from \"../hooks/index.js\";\nimport { useWarnRemoved } from \"../hooks/internal/index.js\";\nimport { invariant } from \"../../utilities/globals/index.js\";\n\n/**\n * @deprecated\n * Official support for React Apollo render prop components ended in March 2020.\n * This library is still included in the `@apollo/client` package,\n * but it no longer receives feature updates or bug fixes.\n */\nexport function Mutation<TData = any, TVariables = OperationVariables>(\n props: MutationComponentOptions<TData, TVariables>\n): ReactTypes.JSX.Element | null {\n useWarnRemoved(\"<Mutation />\", () => {\n invariant.warn(\n \"[Mutation]: The `<Mutation />` component is deprecated and will be removed in Apollo Client 4.0. Please use the `useMutation` React hook instead.\"\n );\n });\n const [runMutation, result] = useMutation(props.mutation, props);\n return props.children ? props.children(runMutation, result) : null;\n}\n\nexport interface Mutation<TData, TVariables> {\n propTypes: PropTypes.InferProps<MutationComponentOptions<TData, TVariables>>;\n}\n\nMutation.propTypes = {\n mutation: PropTypes.object.isRequired,\n variables: PropTypes.object,\n optimisticResponse: PropTypes.oneOfType([PropTypes.object, PropTypes.func]),\n refetchQueries: PropTypes.oneOfType([\n PropTypes.arrayOf(\n PropTypes.oneOfType([PropTypes.string, PropTypes.object])\n ),\n PropTypes.func,\n ]),\n awaitRefetchQueries: PropTypes.bool,\n update: PropTypes.func,\n children: PropTypes.func.isRequired,\n onCompleted: PropTypes.func,\n onError: PropTypes.func,\n fetchPolicy: PropTypes.string,\n} as Mutation<any, any>[\"propTypes\"];\n"]}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
2
|
import * as PropTypes from "prop-types";
|
|
3
3
|
import { useQuery } from "../hooks/index.js";
|
|
4
|
+
import { invariant } from "../../utilities/globals/index.js";
|
|
5
|
+
import { useWarnRemoved } from "../hooks/internal/index.js";
|
|
4
6
|
/**
|
|
5
7
|
* @deprecated
|
|
6
8
|
* Official support for React Apollo render prop components ended in March 2020.
|
|
@@ -8,6 +10,9 @@ import { useQuery } from "../hooks/index.js";
|
|
|
8
10
|
* but it no longer receives feature updates or bug fixes.
|
|
9
11
|
*/
|
|
10
12
|
export function Query(props) {
|
|
13
|
+
useWarnRemoved("<Query />", function () {
|
|
14
|
+
globalThis.__DEV__ !== false && invariant.warn(55);
|
|
15
|
+
});
|
|
11
16
|
var children = props.children, query = props.query, options = __rest(props, ["children", "query"]);
|
|
12
17
|
var result = useQuery(query, options);
|
|
13
18
|
return result ? children(result) : null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Query.js","sourceRoot":"","sources":["../../../src/react/components/Query.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,SAAS,MAAM,YAAY,CAAC;AAKxC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"Query.js","sourceRoot":"","sources":["../../../src/react/components/Query.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,SAAS,MAAM,YAAY,CAAC;AAKxC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D;;;;;GAKG;AACH,MAAM,UAAU,KAAK,CAInB,KAA+C;IAE/C,cAAc,CAAC,WAAW,EAAE;QAC1B,SAAS,CAAC,IAAI,CACZ,2JAA2J,CAC5J,CAAC;IACJ,CAAC,CAAC,CAAC;IACK,IAAA,QAAQ,GAAwB,KAAK,SAA7B,EAAE,KAAK,GAAiB,KAAK,MAAtB,EAAK,OAAO,UAAK,KAAK,EAAvC,qBAA+B,CAAF,CAAW;IAC9C,IAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IACxC,OAAO,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAa,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AACjD,CAAC;AAMD,KAAK,CAAC,SAAS,GAAG;IAChB,MAAM,EAAE,SAAS,CAAC,MAAM;IACxB,QAAQ,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;IACnC,WAAW,EAAE,SAAS,CAAC,MAAM;IAC7B,2BAA2B,EAAE,SAAS,CAAC,IAAI;IAC3C,WAAW,EAAE,SAAS,CAAC,IAAI;IAC3B,OAAO,EAAE,SAAS,CAAC,IAAI;IACvB,YAAY,EAAE,SAAS,CAAC,MAAM;IAC9B,KAAK,EAAE,SAAS,CAAC,MAAM,CAAC,UAAU;IAClC,SAAS,EAAE,SAAS,CAAC,MAAM;IAC3B,GAAG,EAAE,SAAS,CAAC,IAAI;IACnB,cAAc,EAAE,SAAS,CAAC,IAAI;IAC9B,iBAAiB,EAAE,SAAS,CAAC,IAAI;CACF,CAAC","sourcesContent":["import * as PropTypes from \"prop-types\";\nimport type * as ReactTypes from \"react\";\n\nimport type { OperationVariables } from \"../../core/index.js\";\nimport type { QueryComponentOptions } from \"./types.js\";\nimport { useQuery } from \"../hooks/index.js\";\nimport { invariant } from \"../../utilities/globals/index.js\";\nimport { useWarnRemoved } from \"../hooks/internal/index.js\";\n\n/**\n * @deprecated\n * Official support for React Apollo render prop components ended in March 2020.\n * This library is still included in the `@apollo/client` package,\n * but it no longer receives feature updates or bug fixes.\n */\nexport function Query<\n TData = any,\n TVariables extends OperationVariables = OperationVariables,\n>(\n props: QueryComponentOptions<TData, TVariables>\n): ReactTypes.JSX.Element | null {\n useWarnRemoved(\"<Query />\", () => {\n invariant.warn(\n \"[Query]: The `<Query />` component is deprecated and will be removed in Apollo Client 4.0. Please use an available React hook such as `useQuery` instead.\"\n );\n });\n const { children, query, ...options } = props;\n const result = useQuery(query, options);\n return result ? children(result as any) : null;\n}\n\nexport interface Query<TData, TVariables extends OperationVariables> {\n propTypes: PropTypes.InferProps<QueryComponentOptions<TData, TVariables>>;\n}\n\nQuery.propTypes = {\n client: PropTypes.object,\n children: PropTypes.func.isRequired,\n fetchPolicy: PropTypes.string,\n notifyOnNetworkStatusChange: PropTypes.bool,\n onCompleted: PropTypes.func,\n onError: PropTypes.func,\n pollInterval: PropTypes.number,\n query: PropTypes.object.isRequired,\n variables: PropTypes.object,\n ssr: PropTypes.bool,\n partialRefetch: PropTypes.bool,\n returnPartialData: PropTypes.bool,\n} as Query<any, any>[\"propTypes\"];\n"]}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import * as PropTypes from "prop-types";
|
|
2
2
|
import { useSubscription } from "../hooks/index.js";
|
|
3
|
+
import { useWarnRemoved } from "../hooks/internal/index.js";
|
|
4
|
+
import { invariant } from "../../utilities/globals/index.js";
|
|
3
5
|
/**
|
|
4
6
|
* @deprecated
|
|
5
7
|
* Official support for React Apollo render prop components ended in March 2020.
|
|
@@ -7,6 +9,9 @@ import { useSubscription } from "../hooks/index.js";
|
|
|
7
9
|
* but it no longer receives feature updates or bug fixes.
|
|
8
10
|
*/
|
|
9
11
|
export function Subscription(props) {
|
|
12
|
+
useWarnRemoved("<Subscription />", function () {
|
|
13
|
+
globalThis.__DEV__ !== false && invariant.warn(56);
|
|
14
|
+
});
|
|
10
15
|
var result = useSubscription(props.subscription, props);
|
|
11
16
|
return props.children && result ? props.children(result) : null;
|
|
12
17
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Subscription.js","sourceRoot":"","sources":["../../../src/react/components/Subscription.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,YAAY,CAAC;AAKxC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"Subscription.js","sourceRoot":"","sources":["../../../src/react/components/Subscription.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,YAAY,CAAC;AAKxC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAE7D;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAI1B,KAAsD;IAEtD,cAAc,CAAC,kBAAkB,EAAE;QACjC,SAAS,CAAC,IAAI,CACZ,+JAA+J,CAChK,CAAC;IACJ,CAAC,CAAC,CAAC;IACH,IAAM,MAAM,GAAG,eAAe,CAAC,KAAK,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;IAC1D,OAAO,KAAK,CAAC,QAAQ,IAAI,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAClE,CAAC;AAQD,YAAY,CAAC,SAAS,GAAG;IACvB,YAAY,EAAE,SAAS,CAAC,MAAM,CAAC,UAAU;IACzC,SAAS,EAAE,SAAS,CAAC,MAAM;IAC3B,QAAQ,EAAE,SAAS,CAAC,IAAI;IACxB,kBAAkB,EAAE,SAAS,CAAC,IAAI;IAClC,MAAM,EAAE,SAAS,CAAC,IAAI;IACtB,sBAAsB,EAAE,SAAS,CAAC,IAAI;IACtC,UAAU,EAAE,SAAS,CAAC,IAAI;IAC1B,iBAAiB,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,IAAI,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC;CAClC,CAAC","sourcesContent":["import * as PropTypes from \"prop-types\";\nimport type * as ReactTypes from \"react\";\n\nimport type { OperationVariables } from \"../../core/index.js\";\nimport type { SubscriptionComponentOptions } from \"./types.js\";\nimport { useSubscription } from \"../hooks/index.js\";\nimport { useWarnRemoved } from \"../hooks/internal/index.js\";\nimport { invariant } from \"../../utilities/globals/index.js\";\n\n/**\n * @deprecated\n * Official support for React Apollo render prop components ended in March 2020.\n * This library is still included in the `@apollo/client` package,\n * but it no longer receives feature updates or bug fixes.\n */\nexport function Subscription<\n TData = any,\n TVariables extends OperationVariables = OperationVariables,\n>(\n props: SubscriptionComponentOptions<TData, TVariables>\n): ReactTypes.JSX.Element | null {\n useWarnRemoved(\"<Subscription />\", () => {\n invariant.warn(\n \"[Subscription]: The `<Subscription />` component is deprecated and will be removed in Apollo Client 4.0. Please use the `useSubscription` React hook instead.\"\n );\n });\n const result = useSubscription(props.subscription, props);\n return props.children && result ? props.children(result) : null;\n}\n\nexport interface Subscription<TData, TVariables extends OperationVariables> {\n propTypes: PropTypes.InferProps<\n SubscriptionComponentOptions<TData, TVariables>\n >;\n}\n\nSubscription.propTypes = {\n subscription: PropTypes.object.isRequired,\n variables: PropTypes.object,\n children: PropTypes.func,\n onSubscriptionData: PropTypes.func,\n onData: PropTypes.func,\n onSubscriptionComplete: PropTypes.func,\n onComplete: PropTypes.func,\n shouldResubscribe: PropTypes.oneOfType([PropTypes.func, PropTypes.bool]),\n} as Subscription<any, any>[\"propTypes\"];\n"]}
|
|
@@ -5,6 +5,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var tslib = require('tslib');
|
|
6
6
|
var PropTypes = require('prop-types');
|
|
7
7
|
var hooks = require('../hooks');
|
|
8
|
+
var globals = require('../../utilities/globals');
|
|
9
|
+
var React = require('rehackt');
|
|
10
|
+
var optimism = require('optimism');
|
|
8
11
|
|
|
9
12
|
function _interopNamespace(e) {
|
|
10
13
|
if (e && e.__esModule) return e;
|
|
@@ -19,8 +22,33 @@ function _interopNamespace(e) {
|
|
|
19
22
|
}
|
|
20
23
|
|
|
21
24
|
var PropTypes__namespace = /*#__PURE__*/_interopNamespace(PropTypes);
|
|
25
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
26
|
+
|
|
27
|
+
var slot = new optimism.Slot();
|
|
28
|
+
function isMuted(name) {
|
|
29
|
+
return (slot.getValue() || []).includes(name);
|
|
30
|
+
}
|
|
31
|
+
function warnDeprecated(name, cb) {
|
|
32
|
+
if (!isMuted(name)) {
|
|
33
|
+
cb();
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function useWarnRemoved(name, cb) {
|
|
38
|
+
"use no memo";
|
|
39
|
+
var didWarn = React__namespace.useRef(false);
|
|
40
|
+
if (globalThis.__DEV__ !== false) {
|
|
41
|
+
if (!didWarn.current) {
|
|
42
|
+
warnDeprecated(name, cb);
|
|
43
|
+
}
|
|
44
|
+
didWarn.current = true;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
22
47
|
|
|
23
48
|
function Query(props) {
|
|
49
|
+
useWarnRemoved("<Query />", function () {
|
|
50
|
+
globalThis.__DEV__ !== false && globals.invariant.warn(55);
|
|
51
|
+
});
|
|
24
52
|
var children = props.children, query = props.query, options = tslib.__rest(props, ["children", "query"]);
|
|
25
53
|
var result = hooks.useQuery(query, options);
|
|
26
54
|
return result ? children(result) : null;
|
|
@@ -41,6 +69,9 @@ Query.propTypes = {
|
|
|
41
69
|
};
|
|
42
70
|
|
|
43
71
|
function Mutation(props) {
|
|
72
|
+
useWarnRemoved("<Mutation />", function () {
|
|
73
|
+
globalThis.__DEV__ !== false && globals.invariant.warn(54);
|
|
74
|
+
});
|
|
44
75
|
var _a = hooks.useMutation(props.mutation, props), runMutation = _a[0], result = _a[1];
|
|
45
76
|
return props.children ? props.children(runMutation, result) : null;
|
|
46
77
|
}
|
|
@@ -61,6 +92,9 @@ Mutation.propTypes = {
|
|
|
61
92
|
};
|
|
62
93
|
|
|
63
94
|
function Subscription(props) {
|
|
95
|
+
useWarnRemoved("<Subscription />", function () {
|
|
96
|
+
globalThis.__DEV__ !== false && globals.invariant.warn(56);
|
|
97
|
+
});
|
|
64
98
|
var result = hooks.useSubscription(props.subscription, props);
|
|
65
99
|
return props.children && result ? props.children(result) : null;
|
|
66
100
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components.cjs","sources":["Query.js","Mutation.js","Subscription.js"],"sourcesContent":["import { __rest } from \"tslib\";\nimport * as PropTypes from \"prop-types\";\nimport { useQuery } from \"../hooks/index.js\";\n/**\n * @deprecated\n * Official support for React Apollo render prop components ended in March 2020.\n * This library is still included in the `@apollo/client` package,\n * but it no longer receives feature updates or bug fixes.\n */\nexport function Query(props) {\n var children = props.children, query = props.query, options = __rest(props, [\"children\", \"query\"]);\n var result = useQuery(query, options);\n return result ? children(result) : null;\n}\nQuery.propTypes = {\n client: PropTypes.object,\n children: PropTypes.func.isRequired,\n fetchPolicy: PropTypes.string,\n notifyOnNetworkStatusChange: PropTypes.bool,\n onCompleted: PropTypes.func,\n onError: PropTypes.func,\n pollInterval: PropTypes.number,\n query: PropTypes.object.isRequired,\n variables: PropTypes.object,\n ssr: PropTypes.bool,\n partialRefetch: PropTypes.bool,\n returnPartialData: PropTypes.bool,\n};\n//# sourceMappingURL=Query.js.map","import * as PropTypes from \"prop-types\";\nimport { useMutation } from \"../hooks/index.js\";\n/**\n * @deprecated\n * Official support for React Apollo render prop components ended in March 2020.\n * This library is still included in the `@apollo/client` package,\n * but it no longer receives feature updates or bug fixes.\n */\nexport function Mutation(props) {\n var _a = useMutation(props.mutation, props), runMutation = _a[0], result = _a[1];\n return props.children ? props.children(runMutation, result) : null;\n}\nMutation.propTypes = {\n mutation: PropTypes.object.isRequired,\n variables: PropTypes.object,\n optimisticResponse: PropTypes.oneOfType([PropTypes.object, PropTypes.func]),\n refetchQueries: PropTypes.oneOfType([\n PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.object])),\n PropTypes.func,\n ]),\n awaitRefetchQueries: PropTypes.bool,\n update: PropTypes.func,\n children: PropTypes.func.isRequired,\n onCompleted: PropTypes.func,\n onError: PropTypes.func,\n fetchPolicy: PropTypes.string,\n};\n//# sourceMappingURL=Mutation.js.map","import * as PropTypes from \"prop-types\";\nimport { useSubscription } from \"../hooks/index.js\";\n/**\n * @deprecated\n * Official support for React Apollo render prop components ended in March 2020.\n * This library is still included in the `@apollo/client` package,\n * but it no longer receives feature updates or bug fixes.\n */\nexport function Subscription(props) {\n var result = useSubscription(props.subscription, props);\n return props.children && result ? props.children(result) : null;\n}\nSubscription.propTypes = {\n subscription: PropTypes.object.isRequired,\n variables: PropTypes.object,\n children: PropTypes.func,\n onSubscriptionData: PropTypes.func,\n onData: PropTypes.func,\n onSubscriptionComplete: PropTypes.func,\n onComplete: PropTypes.func,\n shouldResubscribe: PropTypes.oneOfType([PropTypes.func, PropTypes.bool]),\n};\n//# sourceMappingURL=Subscription.js.map"],"names":["__rest","useQuery","PropTypes","useMutation","useSubscription"],"mappings":"
|
|
1
|
+
{"version":3,"file":"components.cjs","sources":["../../utilities/deprecation/index.js","../hooks/internal/useWarnRemoved.js","Query.js","Mutation.js","Subscription.js"],"sourcesContent":["import { __spreadArray } from \"tslib\";\nimport { Slot } from \"optimism\";\nimport { invariant } from \"../globals/index.js\";\nvar slot = new Slot();\nfunction isMuted(name) {\n return (slot.getValue() || []).includes(name);\n}\nexport function muteDeprecations(name) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n return slot.withValue.apply(slot, __spreadArray([Array.isArray(name) ? name : [name]], args, false));\n}\nexport function warnRemovedOption(options, name, callSite, recommendation) {\n if (recommendation === void 0) { recommendation = \"Please remove this option.\"; }\n warnDeprecated(name, function () {\n if (name in options) {\n globalThis.__DEV__ !== false && invariant.warn(91, callSite, name, recommendation);\n }\n });\n}\nexport function warnDeprecated(name, cb) {\n if (!isMuted(name)) {\n cb();\n }\n}\n//# sourceMappingURL=index.js.map","import * as React from \"rehackt\";\nimport { warnDeprecated } from \"../../../utilities/deprecation/index.js\";\nexport function useWarnRemoved(name, cb) {\n \"use no memo\";\n var didWarn = React.useRef(false);\n if (globalThis.__DEV__ !== false) {\n if (!didWarn.current) {\n warnDeprecated(name, cb);\n }\n // eslint-disable-next-line react-compiler/react-compiler\n didWarn.current = true;\n }\n}\n//# sourceMappingURL=useWarnRemoved.js.map","import { __rest } from \"tslib\";\nimport * as PropTypes from \"prop-types\";\nimport { useQuery } from \"../hooks/index.js\";\nimport { invariant } from \"../../utilities/globals/index.js\";\nimport { useWarnRemoved } from \"../hooks/internal/index.js\";\n/**\n * @deprecated\n * Official support for React Apollo render prop components ended in March 2020.\n * This library is still included in the `@apollo/client` package,\n * but it no longer receives feature updates or bug fixes.\n */\nexport function Query(props) {\n useWarnRemoved(\"<Query />\", function () {\n globalThis.__DEV__ !== false && invariant.warn(55);\n });\n var children = props.children, query = props.query, options = __rest(props, [\"children\", \"query\"]);\n var result = useQuery(query, options);\n return result ? children(result) : null;\n}\nQuery.propTypes = {\n client: PropTypes.object,\n children: PropTypes.func.isRequired,\n fetchPolicy: PropTypes.string,\n notifyOnNetworkStatusChange: PropTypes.bool,\n onCompleted: PropTypes.func,\n onError: PropTypes.func,\n pollInterval: PropTypes.number,\n query: PropTypes.object.isRequired,\n variables: PropTypes.object,\n ssr: PropTypes.bool,\n partialRefetch: PropTypes.bool,\n returnPartialData: PropTypes.bool,\n};\n//# sourceMappingURL=Query.js.map","import * as PropTypes from \"prop-types\";\nimport { useMutation } from \"../hooks/index.js\";\nimport { useWarnRemoved } from \"../hooks/internal/index.js\";\nimport { invariant } from \"../../utilities/globals/index.js\";\n/**\n * @deprecated\n * Official support for React Apollo render prop components ended in March 2020.\n * This library is still included in the `@apollo/client` package,\n * but it no longer receives feature updates or bug fixes.\n */\nexport function Mutation(props) {\n useWarnRemoved(\"<Mutation />\", function () {\n globalThis.__DEV__ !== false && invariant.warn(54);\n });\n var _a = useMutation(props.mutation, props), runMutation = _a[0], result = _a[1];\n return props.children ? props.children(runMutation, result) : null;\n}\nMutation.propTypes = {\n mutation: PropTypes.object.isRequired,\n variables: PropTypes.object,\n optimisticResponse: PropTypes.oneOfType([PropTypes.object, PropTypes.func]),\n refetchQueries: PropTypes.oneOfType([\n PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.object])),\n PropTypes.func,\n ]),\n awaitRefetchQueries: PropTypes.bool,\n update: PropTypes.func,\n children: PropTypes.func.isRequired,\n onCompleted: PropTypes.func,\n onError: PropTypes.func,\n fetchPolicy: PropTypes.string,\n};\n//# sourceMappingURL=Mutation.js.map","import * as PropTypes from \"prop-types\";\nimport { useSubscription } from \"../hooks/index.js\";\nimport { useWarnRemoved } from \"../hooks/internal/index.js\";\nimport { invariant } from \"../../utilities/globals/index.js\";\n/**\n * @deprecated\n * Official support for React Apollo render prop components ended in March 2020.\n * This library is still included in the `@apollo/client` package,\n * but it no longer receives feature updates or bug fixes.\n */\nexport function Subscription(props) {\n useWarnRemoved(\"<Subscription />\", function () {\n globalThis.__DEV__ !== false && invariant.warn(56);\n });\n var result = useSubscription(props.subscription, props);\n return props.children && result ? props.children(result) : null;\n}\nSubscription.propTypes = {\n subscription: PropTypes.object.isRequired,\n variables: PropTypes.object,\n children: PropTypes.func,\n onSubscriptionData: PropTypes.func,\n onData: PropTypes.func,\n onSubscriptionComplete: PropTypes.func,\n onComplete: PropTypes.func,\n shouldResubscribe: PropTypes.oneOfType([PropTypes.func, PropTypes.bool]),\n};\n//# sourceMappingURL=Subscription.js.map"],"names":["Slot","React","invariant","__rest","useQuery","PropTypes","useMutation","useSubscription"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAI,IAAI,GAAG,IAAIA,aAAI,EAAE,CAAC;AACtB,SAAS,OAAO,CAAC,IAAI,EAAE;AACvB,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,EAAE,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;AAClD,CAAC;AAgBM,SAAS,cAAc,CAAC,IAAI,EAAE,EAAE,EAAE;AACzC,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;AACxB,QAAQ,EAAE,EAAE,CAAC;AACb,KAAK;AACL;;ACxBO,SAAS,cAAc,CAAC,IAAI,EAAE,EAAE,EAAE;AACzC,IAAI,aAAa,CAAC;AAClB,IAAI,IAAI,OAAO,GAAGC,gBAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAA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