@apollo/client 3.14.0-alpha.0 → 3.14.0-alpha.1
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/breezy-lions-rule.md +5 -0
- package/.changeset/great-jobs-fetch.md +5 -0
- package/.changeset/pre.json +4 -1
- package/.changeset/tidy-bulldogs-exercise.md +5 -0
- package/CHANGELOG.md +10 -0
- package/apollo-client.cjs +187 -119
- package/apollo-client.cjs.map +1 -1
- package/apollo-client.min.cjs +1 -1
- package/cache/cache.cjs +7 -2
- package/cache/cache.cjs.map +1 -1
- package/cache/cache.cjs.native.js +7 -2
- package/cache/inmemory/inMemoryCache.d.ts +8 -0
- package/cache/inmemory/inMemoryCache.js +3 -0
- package/cache/inmemory/inMemoryCache.js.map +1 -1
- package/core/ApolloClient.d.ts +9 -9
- package/core/ApolloClient.js +6 -1
- package/core/ApolloClient.js.map +1 -1
- package/core/LocalState.js +2 -2
- package/core/ObservableQuery.d.ts +51 -6
- package/core/ObservableQuery.js +89 -13
- package/core/ObservableQuery.js.map +1 -1
- package/core/QueryInfo.js +6 -3
- package/core/QueryInfo.js.map +1 -1
- package/core/QueryManager.js +14 -12
- package/core/QueryManager.js.map +1 -1
- package/core/core.cjs +85 -33
- package/core/core.cjs.map +1 -1
- package/core/core.cjs.native.js +85 -33
- package/core/types.d.ts +177 -3
- package/core/types.js.map +1 -1
- package/core/watchQueryOptions.d.ts +10 -2
- package/core/watchQueryOptions.js.map +1 -1
- package/dev/dev.cjs +149 -97
- package/dev/dev.cjs.map +1 -1
- package/dev/dev.cjs.native.js +149 -97
- package/errors/errors.cjs.map +1 -1
- package/errors/index.d.ts +19 -0
- package/errors/index.js +19 -0
- package/errors/index.js.map +1 -1
- package/invariantErrorCodes.js +161 -96
- package/link/batch-http/batch-http.cjs +9 -0
- package/link/batch-http/batch-http.cjs.map +1 -1
- package/link/batch-http/batch-http.cjs.native.js +9 -0
- package/link/batch-http/batchHttpLink.js +9 -0
- package/link/batch-http/batchHttpLink.js.map +1 -1
- package/link/core/ApolloLink.d.ts +8 -0
- package/link/core/ApolloLink.js +19 -2
- package/link/core/ApolloLink.js.map +1 -1
- package/link/core/core.cjs +24 -2
- package/link/core/core.cjs.map +1 -1
- package/link/core/core.cjs.native.js +24 -2
- package/link/core/types.d.ts +20 -0
- package/link/core/types.js.map +1 -1
- package/link/error/index.d.ts +48 -0
- package/link/error/index.js.map +1 -1
- package/link/http/checkFetcher.js +1 -1
- package/link/http/createHttpLink.js +4 -1
- package/link/http/createHttpLink.js.map +1 -1
- package/link/http/http.cjs +6 -3
- package/link/http/http.cjs.map +1 -1
- package/link/http/http.cjs.native.js +6 -3
- package/link/http/serializeFetchParameter.js +1 -1
- package/link/persisted-queries/index.d.ts +38 -0
- package/link/persisted-queries/index.js +2 -2
- package/link/persisted-queries/index.js.map +1 -1
- 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/fromError.d.ts +16 -0
- package/link/utils/fromError.js +16 -0
- package/link/utils/fromError.js.map +1 -1
- package/link/utils/fromPromise.d.ts +16 -0
- package/link/utils/fromPromise.js +16 -0
- package/link/utils/fromPromise.js.map +1 -1
- package/link/utils/throwServerError.d.ts +30 -0
- package/link/utils/throwServerError.js +17 -0
- package/link/utils/throwServerError.js.map +1 -1
- package/link/utils/toPromise.d.ts +16 -0
- package/link/utils/toPromise.js +17 -1
- package/link/utils/toPromise.js.map +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/masking/utils.js.map +1 -1
- package/package.json +1 -1
- package/react/components/Mutation.js +1 -1
- package/react/components/Query.js +1 -1
- package/react/components/Subscription.js +1 -1
- package/react/components/components.cjs +6 -4
- package/react/components/components.cjs.map +1 -1
- package/react/components/components.cjs.native.js +6 -4
- package/react/context/ApolloConsumer.js +1 -1
- package/react/context/ApolloContext.js +2 -2
- package/react/context/ApolloProvider.js +1 -1
- package/react/context/context.cjs +4 -4
- package/react/context/context.cjs.map +1 -1
- package/react/context/context.cjs.native.js +4 -4
- package/react/hoc/graphql.js +1 -1
- package/react/hoc/hoc-utils.js +1 -1
- package/react/hoc/hoc.cjs +9 -7
- package/react/hoc/hoc.cjs.map +1 -1
- package/react/hoc/hoc.cjs.native.js +9 -7
- package/react/hoc/mutation-hoc.js +1 -1
- package/react/hoc/query-hoc.js +1 -1
- package/react/hoc/subscription-hoc.js +1 -1
- package/react/hoc/withApollo.js +1 -1
- package/react/hooks/hooks.cjs +18 -16
- package/react/hooks/hooks.cjs.map +1 -1
- package/react/hooks/hooks.cjs.native.js +18 -16
- package/react/hooks/internal/useWarnRemoved.d.ts +2 -1
- package/react/hooks/internal/useWarnRemoved.js.map +1 -1
- package/react/hooks/internal/useWarnRemovedOption.js +1 -1
- package/react/hooks/useApolloClient.js +1 -1
- package/react/hooks/useLazyQuery.js +2 -2
- package/react/hooks/useLoadableQuery.js +2 -2
- package/react/hooks/useQuery.js +1 -1
- package/react/hooks/useSubscription.js +3 -3
- package/react/hooks/useSuspenseQuery.js +2 -2
- package/react/hooks/useSyncExternalStore.js +1 -1
- package/react/internal/cache/QueryReference.d.ts +1 -0
- package/react/internal/cache/QueryReference.js +5 -2
- package/react/internal/cache/QueryReference.js.map +1 -1
- package/react/internal/internal.cjs +16 -3
- package/react/internal/internal.cjs.map +1 -1
- package/react/internal/internal.cjs.native.js +16 -3
- package/react/parser/index.js +6 -6
- package/react/parser/parser.cjs +9 -7
- package/react/parser/parser.cjs.map +1 -1
- package/react/parser/parser.cjs.native.js +9 -7
- package/react/react.cjs +4 -2
- package/react/react.cjs.map +1 -1
- package/react/react.cjs.native.js +4 -2
- package/react/types/types.d.ts +40 -0
- package/react/types/types.documentation.d.ts +1 -1
- package/react/types/types.documentation.js.map +1 -1
- package/react/types/types.js.map +1 -1
- package/testing/core/core.cjs +17 -3
- package/testing/core/core.cjs.map +1 -1
- package/testing/core/core.cjs.native.js +17 -3
- package/testing/core/itAsync.d.ts +5 -0
- package/testing/core/itAsync.js +5 -0
- package/testing/core/itAsync.js.map +1 -1
- package/testing/core/mocking/mockClient.d.ts +4 -0
- package/testing/core/mocking/mockClient.js +4 -0
- package/testing/core/mocking/mockClient.js.map +1 -1
- package/testing/core/mocking/mockLink.d.ts +10 -0
- package/testing/core/mocking/mockLink.js +23 -4
- package/testing/core/mocking/mockLink.js.map +1 -1
- package/testing/core/mocking/mockSubscriptionLink.d.ts +4 -0
- package/testing/core/mocking/mockSubscriptionLink.js +4 -0
- package/testing/core/mocking/mockSubscriptionLink.js.map +1 -1
- package/testing/core/subscribeAndCount.d.ts +4 -0
- package/testing/core/subscribeAndCount.js +4 -0
- package/testing/core/subscribeAndCount.js.map +1 -1
- package/testing/experimental/createSchemaFetch.d.ts +1 -1
- package/testing/experimental/createSchemaFetch.js +1 -1
- package/testing/experimental/createSchemaFetch.js.map +1 -1
- package/testing/experimental/createTestSchema.d.ts +1 -1
- package/testing/experimental/createTestSchema.js +1 -1
- package/testing/experimental/createTestSchema.js.map +1 -1
- package/testing/experimental/experimental.cjs.map +1 -1
- package/testing/testing.cjs +4 -2
- package/testing/testing.cjs.map +1 -1
- package/testing/testing.cjs.native.js +4 -2
- package/utilities/deprecation/index.d.ts +83 -3
- package/utilities/deprecation/index.js +15 -3
- package/utilities/deprecation/index.js.map +1 -1
- 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/observables/asyncMap.d.ts +13 -0
- package/utilities/observables/asyncMap.js +13 -0
- package/utilities/observables/asyncMap.js.map +1 -1
- package/utilities/observables/iteration.d.ts +4 -0
- package/utilities/observables/iteration.js +4 -0
- package/utilities/observables/iteration.js.map +1 -1
- package/utilities/subscriptions/urql/index.d.ts +5 -0
- package/utilities/subscriptions/urql/index.js +5 -0
- package/utilities/subscriptions/urql/index.js.map +1 -1
- package/utilities/subscriptions/urql/urql.cjs.map +1 -1
- 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
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, 61, 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, 62, 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, 63);
|
|
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(64);
|
|
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, 59, 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(60, 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, 61, 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, 62, 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, 63);
|
|
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(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,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,CAAC;AACtB,KAAK,CAAC,CAAC;AACP,CAAC;AACD,SAAS,gBAAgB,CAAC,IAAI,EAAE,cAAc,EAAE;AAChD,IAAI,IAAI,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;AAClC,QAAQ,OAAO,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AACxC,KAAK;AACL,IAAI,IAAI,aAAa,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE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,KAAK,EAAE,KAAK;AACpB,QAAQ,cAAc,EAAE,IAAI,OAAO,EAAE;AACrC,QAAQ,YAAY,EAAE,IAAI,OAAO,EAAE;AACnC,KAAK,CAAC,CAAC;AACP;;ACpCO,SAAS,aAAa,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE;AACrD,IAAI,IAAI,EAAE,CAAC;AACX,IAAI,IAAI,CAAC,KAAK,CAAC,eAAe,EAAE;AAChC,QAAQ,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;;;;;;"}
|
|
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(64);\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, 59, 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(60, 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, 61, fragments.length);\n fragmentName = fragments[0].name.value;\n }\n var fragment = fragments.find(function (fragment) { return fragment.name.value === fragmentName; });\n invariant(!!fragment, 62, 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, 63);\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,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B,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(64);
|
|
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, 59, 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(60, 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, 61, 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, 62, 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, 63);
|
|
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(64);
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
//# sourceMappingURL=utils.js.map
|
package/masking/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/masking/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAErE,MAAM,CAAC,IAAM,OAAO,GAAG,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC;AACrD,MAAM,CAAC,IAAM,OAAO,GAAG,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC;AAErD,gFAAgF;AAChF,gBAAgB;AAChB,gBAAgB;AAChB,MAAM,CAAC,IAAM,mBAAmB,GAAG,IAAI,IAAI,EAAW,CAAC;AAEvD,IAAI,aAAa,GAAG,KAAK,CAAC;AAC1B,MAAM,UAAU,iCAAiC;IAC/C,IAAI,CAAC,aAAa,EAAE,CAAC;QACnB,aAAa,GAAG,IAAI,CAAC;QACrB,SAAS,CAAC,IAAI,CACZ,
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/masking/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAErE,MAAM,CAAC,IAAM,OAAO,GAAG,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC;AACrD,MAAM,CAAC,IAAM,OAAO,GAAG,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC;AAErD,gFAAgF;AAChF,gBAAgB;AAChB,gBAAgB;AAChB,MAAM,CAAC,IAAM,mBAAmB,GAAG,IAAI,IAAI,EAAW,CAAC;AAEvD,IAAI,aAAa,GAAG,KAAK,CAAC;AAC1B,MAAM,UAAU,iCAAiC;IAC/C,IAAI,CAAC,aAAa,EAAE,CAAC;QACnB,aAAa,GAAG,IAAI,CAAC;QACrB,SAAS,CAAC,IAAI,CACZ,2QAA2Q,CAC5Q,CAAC;IACJ,CAAC;AACH,CAAC","sourcesContent":["import { Slot } from \"optimism\";\nimport { invariant } from \"../utilities/globals/index.js\";\nimport { canUseWeakMap, canUseWeakSet } from \"../utilities/index.js\";\n\nexport const MapImpl = canUseWeakMap ? WeakMap : Map;\nexport const SetImpl = canUseWeakSet ? WeakSet : Set;\n\n// Contextual slot that allows us to disable accessor warnings on fields when in\n// migrate mode.\n/** @internal */\nexport const disableWarningsSlot = new Slot<boolean>();\n\nlet issuedWarning = false;\nexport function warnOnImproperCacheImplementation() {\n if (!issuedWarning) {\n issuedWarning = true;\n invariant.warn(\n \"The configured cache does not support data masking which effectively disables it. Please use a cache that supports data masking or disable data masking to silence this warning. Caches will be required to support the necessary data masking APIs in Apollo Client 4.0.\"\n );\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@ import { invariant } from "../../utilities/globals/index.js";
|
|
|
10
10
|
*/
|
|
11
11
|
export function Mutation(props) {
|
|
12
12
|
useWarnRemoved("<Mutation />", function () {
|
|
13
|
-
globalThis.__DEV__ !== false && invariant.warn(
|
|
13
|
+
globalThis.__DEV__ !== false && invariant.warn(65);
|
|
14
14
|
});
|
|
15
15
|
var _a = useMutation(props.mutation, props), runMutation = _a[0], result = _a[1];
|
|
16
16
|
return props.children ? props.children(runMutation, result) : null;
|
|
@@ -11,7 +11,7 @@ import { useWarnRemoved } from "../hooks/internal/index.js";
|
|
|
11
11
|
*/
|
|
12
12
|
export function Query(props) {
|
|
13
13
|
useWarnRemoved("<Query />", function () {
|
|
14
|
-
globalThis.__DEV__ !== false && invariant.warn(
|
|
14
|
+
globalThis.__DEV__ !== false && invariant.warn(66);
|
|
15
15
|
});
|
|
16
16
|
var children = props.children, query = props.query, options = __rest(props, ["children", "query"]);
|
|
17
17
|
var result = useQuery(query, options);
|
|
@@ -10,7 +10,7 @@ import { invariant } from "../../utilities/globals/index.js";
|
|
|
10
10
|
*/
|
|
11
11
|
export function Subscription(props) {
|
|
12
12
|
useWarnRemoved("<Subscription />", function () {
|
|
13
|
-
globalThis.__DEV__ !== false && invariant.warn(
|
|
13
|
+
globalThis.__DEV__ !== false && invariant.warn(67);
|
|
14
14
|
});
|
|
15
15
|
var result = useSubscription(props.subscription, props);
|
|
16
16
|
return props.children && result ? props.children(result) : null;
|
|
@@ -24,9 +24,11 @@ function _interopNamespace(e) {
|
|
|
24
24
|
var PropTypes__namespace = /*#__PURE__*/_interopNamespace(PropTypes);
|
|
25
25
|
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
26
26
|
|
|
27
|
+
var muteAllDeprecations = Symbol.for("apollo.deprecations");
|
|
28
|
+
var global = globals.global;
|
|
27
29
|
var slot = new optimism.Slot();
|
|
28
30
|
function isMuted(name) {
|
|
29
|
-
return (slot.getValue() || []).includes(name);
|
|
31
|
+
return global[muteAllDeprecations] || (slot.getValue() || []).includes(name);
|
|
30
32
|
}
|
|
31
33
|
function warnDeprecated(name, cb) {
|
|
32
34
|
if (!isMuted(name)) {
|
|
@@ -47,7 +49,7 @@ function useWarnRemoved(name, cb) {
|
|
|
47
49
|
|
|
48
50
|
function Query(props) {
|
|
49
51
|
useWarnRemoved("<Query />", function () {
|
|
50
|
-
globalThis.__DEV__ !== false && globals.invariant.warn(
|
|
52
|
+
globalThis.__DEV__ !== false && globals.invariant.warn(66);
|
|
51
53
|
});
|
|
52
54
|
var children = props.children, query = props.query, options = tslib.__rest(props, ["children", "query"]);
|
|
53
55
|
var result = hooks.useQuery(query, options);
|
|
@@ -70,7 +72,7 @@ Query.propTypes = {
|
|
|
70
72
|
|
|
71
73
|
function Mutation(props) {
|
|
72
74
|
useWarnRemoved("<Mutation />", function () {
|
|
73
|
-
globalThis.__DEV__ !== false && globals.invariant.warn(
|
|
75
|
+
globalThis.__DEV__ !== false && globals.invariant.warn(65);
|
|
74
76
|
});
|
|
75
77
|
var _a = hooks.useMutation(props.mutation, props), runMutation = _a[0], result = _a[1];
|
|
76
78
|
return props.children ? props.children(runMutation, result) : null;
|
|
@@ -93,7 +95,7 @@ Mutation.propTypes = {
|
|
|
93
95
|
|
|
94
96
|
function Subscription(props) {
|
|
95
97
|
useWarnRemoved("<Subscription />", function () {
|
|
96
|
-
globalThis.__DEV__ !== false && globals.invariant.warn(
|
|
98
|
+
globalThis.__DEV__ !== false && globals.invariant.warn(67);
|
|
97
99
|
});
|
|
98
100
|
var result = hooks.useSubscription(props.subscription, props);
|
|
99
101
|
return props.children && result ? props.children(result) : null;
|
|
@@ -1 +1 @@
|
|
|
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(
|
|
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, global as untypedGlobal } from \"../globals/index.js\";\nvar muteAllDeprecations = Symbol.for(\"apollo.deprecations\");\nvar global = untypedGlobal;\nvar slot = new Slot();\nfunction isMuted(name) {\n return global[muteAllDeprecations] || (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(104, callSite, name, recommendation);\n }\n });\n}\nexport function warnDeprecated(name, cb) {\n if (!isMuted(name)) {\n cb();\n }\n}\nexport function withDisabledDeprecations() {\n var _a;\n var prev = global[muteAllDeprecations];\n global[muteAllDeprecations] = true;\n return _a = {},\n _a[Symbol.dispose] = function () {\n global[muteAllDeprecations] = prev;\n },\n _a;\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(66);\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(65);\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(67);\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":["untypedGlobal","Slot","React","invariant","__rest","useQuery","PropTypes","useMutation","useSubscription"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAI,mBAAmB,GAAG,MAAM,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;AAC5D,IAAI,MAAM,GAAGA,cAAa,CAAC;AAC3B,IAAI,IAAI,GAAG,IAAIC,aAAI,EAAE,CAAC;AACtB,SAAS,OAAO,CAAC,IAAI,EAAE;AACvB,IAAI,OAAO,MAAM,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,EAAE,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;AACjF,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;;AC1BO,SAAS,cAAc,CAAC,IAAI,EAAE,EAAE,EAAE;AACzC,IAAI,aAAa,CAAC;AAClB,IAAI,IAAI,OAAO,GAAGC,gBAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACtC,IAAI,IAAI,UAAU,CAAC,OAAO,KAAK,KAAK,EAAE;AACtC,QAAQ,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE;AAC9B,YAAY,cAAc,CAAC,IAAI,EAAE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AC3B,IAAI,WAAW,EAAEA,oBAAS,CAAC,MAAM;AACjC,CAAC;;ACrBM,SAAS,YAAY,CAAC,KAAK,EAAE;AACpC,IAAI,cAAc,CAAC,kBAAkB,EAAE,YAAY;AACnD,QAAQ,UAAU,CAAC,OAAO,KAAK,KAAK,IAAIH,iBAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC3D,KAAK,CAAC,CAAC;AACP,IAAI,IAAI,MAAM,GAAGK,qBAAe,CAAC,KAAK,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;AAC5D,IAAI,OAAO,KAAK,CAAC,QAAQ,IAAI,MAAM,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;AACpE,CAAC;AACD,YAAY,CAAC,SAAS,GAAG;AACzB,IAAI,YAAY,EAAEF,oBAAS,CAAC,MAAM,CAAC,UAAU;AAC7C,IAAI,SAAS,EAAEA,oBAAS,CAAC,MAAM;AAC/B,IAAI,QAAQ,EAAEA,oBAAS,CAAC,IAAI;AAC5B,IAAI,kBAAkB,EAAEA,oBAAS,CAAC,IAAI;AACtC,IAAI,MAAM,EAAEA,oBAAS,CAAC,IAAI;AAC1B,IAAI,sBAAsB,EAAEA,oBAAS,CAAC,IAAI;AAC1C,IAAI,UAAU,EAAEA,oBAAS,CAAC,IAAI;AAC9B,IAAI,iBAAiB,EAAEA,oBAAS,CAAC,SAAS,CAAC,CAACA,oBAAS,CAAC,IAAI,EAAEA,oBAAS,CAAC,IAAI,CAAC,CAAC;AAC5E,CAAC;;;;;;"}
|
|
@@ -24,9 +24,11 @@ function _interopNamespace(e) {
|
|
|
24
24
|
var PropTypes__namespace = /*#__PURE__*/_interopNamespace(PropTypes);
|
|
25
25
|
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
26
26
|
|
|
27
|
+
var muteAllDeprecations = Symbol.for("apollo.deprecations");
|
|
28
|
+
var global = globals.global;
|
|
27
29
|
var slot = new optimism.Slot();
|
|
28
30
|
function isMuted(name) {
|
|
29
|
-
return (slot.getValue() || []).includes(name);
|
|
31
|
+
return global[muteAllDeprecations] || (slot.getValue() || []).includes(name);
|
|
30
32
|
}
|
|
31
33
|
function warnDeprecated(name, cb) {
|
|
32
34
|
if (!isMuted(name)) {
|
|
@@ -47,7 +49,7 @@ function useWarnRemoved(name, cb) {
|
|
|
47
49
|
|
|
48
50
|
function Query(props) {
|
|
49
51
|
useWarnRemoved("<Query />", function () {
|
|
50
|
-
globalThis.__DEV__ !== false && globals.invariant.warn(
|
|
52
|
+
globalThis.__DEV__ !== false && globals.invariant.warn(66);
|
|
51
53
|
});
|
|
52
54
|
var children = props.children, query = props.query, options = tslib.__rest(props, ["children", "query"]);
|
|
53
55
|
var result = hooks.useQuery(query, options);
|
|
@@ -70,7 +72,7 @@ Query.propTypes = {
|
|
|
70
72
|
|
|
71
73
|
function Mutation(props) {
|
|
72
74
|
useWarnRemoved("<Mutation />", function () {
|
|
73
|
-
globalThis.__DEV__ !== false && globals.invariant.warn(
|
|
75
|
+
globalThis.__DEV__ !== false && globals.invariant.warn(65);
|
|
74
76
|
});
|
|
75
77
|
var _a = hooks.useMutation(props.mutation, props), runMutation = _a[0], result = _a[1];
|
|
76
78
|
return props.children ? props.children(runMutation, result) : null;
|
|
@@ -93,7 +95,7 @@ Mutation.propTypes = {
|
|
|
93
95
|
|
|
94
96
|
function Subscription(props) {
|
|
95
97
|
useWarnRemoved("<Subscription />", function () {
|
|
96
|
-
globalThis.__DEV__ !== false && globals.invariant.warn(
|
|
98
|
+
globalThis.__DEV__ !== false && globals.invariant.warn(67);
|
|
97
99
|
});
|
|
98
100
|
var result = hooks.useSubscription(props.subscription, props);
|
|
99
101
|
return props.children && result ? props.children(result) : null;
|
|
@@ -4,7 +4,7 @@ import { getApolloContext } from "./ApolloContext.js";
|
|
|
4
4
|
export var ApolloConsumer = function (props) {
|
|
5
5
|
var ApolloContext = getApolloContext();
|
|
6
6
|
return (React.createElement(ApolloContext.Consumer, null, function (context) {
|
|
7
|
-
invariant(context && context.client,
|
|
7
|
+
invariant(context && context.client, 68);
|
|
8
8
|
return props.children(context.client);
|
|
9
9
|
}));
|
|
10
10
|
};
|
|
@@ -7,7 +7,7 @@ import { invariant } from "../../utilities/globals/index.js";
|
|
|
7
7
|
// context), a single Apollo context is created and tracked in global state.
|
|
8
8
|
var contextKey = canUseSymbol ? Symbol.for("__APOLLO_CONTEXT__") : "__APOLLO_CONTEXT__";
|
|
9
9
|
export function getApolloContext() {
|
|
10
|
-
invariant("createContext" in React,
|
|
10
|
+
invariant("createContext" in React, 69);
|
|
11
11
|
var context = React.createContext[contextKey];
|
|
12
12
|
if (!context) {
|
|
13
13
|
Object.defineProperty(React.createContext, contextKey, {
|
|
@@ -27,7 +27,7 @@ export function getApolloContext() {
|
|
|
27
27
|
*/
|
|
28
28
|
export var resetApolloContext = function () {
|
|
29
29
|
if (globalThis.__DEV__ !== false) {
|
|
30
|
-
globalThis.__DEV__ !== false && invariant.warn(
|
|
30
|
+
globalThis.__DEV__ !== false && invariant.warn(70);
|
|
31
31
|
}
|
|
32
32
|
return getApolloContext();
|
|
33
33
|
};
|
|
@@ -9,7 +9,7 @@ export var ApolloProvider = function (_a) {
|
|
|
9
9
|
var context = React.useMemo(function () {
|
|
10
10
|
return __assign(__assign({}, parentContext), { client: client || parentContext.client });
|
|
11
11
|
}, [parentContext, client]);
|
|
12
|
-
invariant(context.client,
|
|
12
|
+
invariant(context.client, 71);
|
|
13
13
|
return (React.createElement(ApolloContext.Provider, { value: context }, children));
|
|
14
14
|
};
|
|
15
15
|
//# sourceMappingURL=ApolloProvider.js.map
|
|
@@ -23,7 +23,7 @@ var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
|
23
23
|
|
|
24
24
|
var contextKey = utilities.canUseSymbol ? Symbol.for("__APOLLO_CONTEXT__") : "__APOLLO_CONTEXT__";
|
|
25
25
|
function getApolloContext() {
|
|
26
|
-
globals.invariant("createContext" in React__namespace,
|
|
26
|
+
globals.invariant("createContext" in React__namespace, 69);
|
|
27
27
|
var context = React__namespace.createContext[contextKey];
|
|
28
28
|
if (!context) {
|
|
29
29
|
Object.defineProperty(React__namespace.createContext, contextKey, {
|
|
@@ -38,7 +38,7 @@ function getApolloContext() {
|
|
|
38
38
|
}
|
|
39
39
|
var resetApolloContext = function () {
|
|
40
40
|
if (globalThis.__DEV__ !== false) {
|
|
41
|
-
globalThis.__DEV__ !== false && globals.invariant.warn(
|
|
41
|
+
globalThis.__DEV__ !== false && globals.invariant.warn(70);
|
|
42
42
|
}
|
|
43
43
|
return getApolloContext();
|
|
44
44
|
};
|
|
@@ -46,7 +46,7 @@ var resetApolloContext = function () {
|
|
|
46
46
|
var ApolloConsumer = function (props) {
|
|
47
47
|
var ApolloContext = getApolloContext();
|
|
48
48
|
return (React__namespace.createElement(ApolloContext.Consumer, null, function (context) {
|
|
49
|
-
globals.invariant(context && context.client,
|
|
49
|
+
globals.invariant(context && context.client, 68);
|
|
50
50
|
return props.children(context.client);
|
|
51
51
|
}));
|
|
52
52
|
};
|
|
@@ -58,7 +58,7 @@ var ApolloProvider = function (_a) {
|
|
|
58
58
|
var context = React__namespace.useMemo(function () {
|
|
59
59
|
return tslib.__assign(tslib.__assign({}, parentContext), { client: client || parentContext.client });
|
|
60
60
|
}, [parentContext, client]);
|
|
61
|
-
globals.invariant(context.client,
|
|
61
|
+
globals.invariant(context.client, 71);
|
|
62
62
|
return (React__namespace.createElement(ApolloContext.Provider, { value: context }, children));
|
|
63
63
|
};
|
|
64
64
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.cjs","sources":["ApolloContext.js","ApolloConsumer.js","ApolloProvider.js"],"sourcesContent":["import * as React from \"rehackt\";\nimport { canUseSymbol } from \"../../utilities/index.js\";\nimport { invariant } from \"../../utilities/globals/index.js\";\n// To make sure Apollo Client doesn't create more than one React context\n// (which can lead to problems like having an Apollo Client instance added\n// in one context, then attempting to retrieve it from another different\n// context), a single Apollo context is created and tracked in global state.\nvar contextKey = canUseSymbol ? Symbol.for(\"__APOLLO_CONTEXT__\") : \"__APOLLO_CONTEXT__\";\nexport function getApolloContext() {\n invariant(\"createContext\" in React,
|
|
1
|
+
{"version":3,"file":"context.cjs","sources":["ApolloContext.js","ApolloConsumer.js","ApolloProvider.js"],"sourcesContent":["import * as React from \"rehackt\";\nimport { canUseSymbol } from \"../../utilities/index.js\";\nimport { invariant } from \"../../utilities/globals/index.js\";\n// To make sure Apollo Client doesn't create more than one React context\n// (which can lead to problems like having an Apollo Client instance added\n// in one context, then attempting to retrieve it from another different\n// context), a single Apollo context is created and tracked in global state.\nvar contextKey = canUseSymbol ? Symbol.for(\"__APOLLO_CONTEXT__\") : \"__APOLLO_CONTEXT__\";\nexport function getApolloContext() {\n invariant(\"createContext\" in React, 69);\n var context = React.createContext[contextKey];\n if (!context) {\n Object.defineProperty(React.createContext, contextKey, {\n value: (context = React.createContext({})),\n enumerable: false,\n writable: false,\n configurable: true,\n });\n context.displayName = \"ApolloContext\";\n }\n return context;\n}\n/**\n * @deprecated This function has no \"resetting\" effect since Apollo Client 3.4.12,\n * and will be removed in the next major version of Apollo Client.\n * If you want to get the Apollo Context, use `getApolloContext` instead.\n */\nexport var resetApolloContext = function () {\n if (globalThis.__DEV__ !== false) {\n globalThis.__DEV__ !== false && invariant.warn(70);\n }\n return getApolloContext();\n};\n//# sourceMappingURL=ApolloContext.js.map","import { invariant } from \"../../utilities/globals/index.js\";\nimport * as React from \"rehackt\";\nimport { getApolloContext } from \"./ApolloContext.js\";\nexport var ApolloConsumer = function (props) {\n var ApolloContext = getApolloContext();\n return (React.createElement(ApolloContext.Consumer, null, function (context) {\n invariant(context && context.client, 68);\n return props.children(context.client);\n }));\n};\n//# sourceMappingURL=ApolloConsumer.js.map","import { __assign } from \"tslib\";\nimport { invariant } from \"../../utilities/globals/index.js\";\nimport * as React from \"rehackt\";\nimport { getApolloContext } from \"./ApolloContext.js\";\nexport var ApolloProvider = function (_a) {\n var client = _a.client, children = _a.children;\n var ApolloContext = getApolloContext();\n var parentContext = React.useContext(ApolloContext);\n var context = React.useMemo(function () {\n return __assign(__assign({}, parentContext), { client: client || parentContext.client });\n }, [parentContext, client]);\n invariant(context.client, 71);\n return (React.createElement(ApolloContext.Provider, { value: context }, children));\n};\n//# sourceMappingURL=ApolloProvider.js.map"],"names":["canUseSymbol","invariant","React","__assign"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAOA,IAAI,UAAU,GAAGA,sBAAY,GAAG,MAAM,CAAC,GAAG,CAAC,oBAAoB,CAAC,GAAG,oBAAoB,CAAC;AACjF,SAAS,gBAAgB,GAAG;AACnC,IAAIC,iBAAS,CAAC,eAAe,IAAIC,gBAAK,EAAE,EAAE,CAAC,CAAC;AAC5C,IAAI,IAAI,OAAO,GAAGA,gBAAK,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;AAClD,IAAI,IAAI,CAAC,OAAO,EAAE;AAClB,QAAQ,MAAM,CAAC,cAAc,CAACA,gBAAK,CAAC,aAAa,EAAE,UAAU,EAAE;AAC/D,YAAY,KAAK,GAAG,OAAO,GAAGA,gBAAK,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;AACtD,YAAY,UAAU,EAAE,KAAK;AAC7B,YAAY,QAAQ,EAAE,KAAK;AAC3B,YAAY,YAAY,EAAE,IAAI;AAC9B,SAAS,CAAC,CAAC;AACX,QAAQ,OAAO,CAAC,WAAW,GAAG,eAAe,CAAC;AAC9C,KAAK;AACL,IAAI,OAAO,OAAO,CAAC;AACnB,CAAC;AAMS,IAAC,kBAAkB,GAAG,YAAY;AAC5C,IAAI,IAAI,UAAU,CAAC,OAAO,KAAK,KAAK,EAAE;AACtC,QAAQ,UAAU,CAAC,OAAO,KAAK,KAAK,IAAID,iBAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC3D,KAAK;AACL,IAAI,OAAO,gBAAgB,EAAE,CAAC;AAC9B;;AC7BU,IAAC,cAAc,GAAG,UAAU,K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O_CONTEXT__";
|
|
25
25
|
function getApolloContext() {
|
|
26
|
-
globals.invariant("createContext" in React__namespace,
|
|
26
|
+
globals.invariant("createContext" in React__namespace, 69);
|
|
27
27
|
var context = React__namespace.createContext[contextKey];
|
|
28
28
|
if (!context) {
|
|
29
29
|
Object.defineProperty(React__namespace.createContext, contextKey, {
|
|
@@ -38,7 +38,7 @@ function getApolloContext() {
|
|
|
38
38
|
}
|
|
39
39
|
var resetApolloContext = function () {
|
|
40
40
|
if (globalThis.__DEV__ !== false) {
|
|
41
|
-
globalThis.__DEV__ !== false && globals.invariant.warn(
|
|
41
|
+
globalThis.__DEV__ !== false && globals.invariant.warn(70);
|
|
42
42
|
}
|
|
43
43
|
return getApolloContext();
|
|
44
44
|
};
|
|
@@ -46,7 +46,7 @@ var resetApolloContext = function () {
|
|
|
46
46
|
var ApolloConsumer = function (props) {
|
|
47
47
|
var ApolloContext = getApolloContext();
|
|
48
48
|
return (React__namespace.createElement(ApolloContext.Consumer, null, function (context) {
|
|
49
|
-
globals.invariant(context && context.client,
|
|
49
|
+
globals.invariant(context && context.client, 68);
|
|
50
50
|
return props.children(context.client);
|
|
51
51
|
}));
|
|
52
52
|
};
|
|
@@ -58,7 +58,7 @@ var ApolloProvider = function (_a) {
|
|
|
58
58
|
var context = React__namespace.useMemo(function () {
|
|
59
59
|
return tslib.__assign(tslib.__assign({}, parentContext), { client: client || parentContext.client });
|
|
60
60
|
}, [parentContext, client]);
|
|
61
|
-
globals.invariant(context.client,
|
|
61
|
+
globals.invariant(context.client, 71);
|
|
62
62
|
return (React__namespace.createElement(ApolloContext.Provider, { value: context }, children));
|
|
63
63
|
};
|
|
64
64
|
|
package/react/hoc/graphql.js
CHANGED
|
@@ -13,7 +13,7 @@ export function graphql(document, operationOptions) {
|
|
|
13
13
|
if (operationOptions === void 0) { operationOptions = {}; }
|
|
14
14
|
if (globalThis.__DEV__ !== false) {
|
|
15
15
|
warnDeprecated("graphql", function () {
|
|
16
|
-
globalThis.__DEV__ !== false && invariant.warn(
|
|
16
|
+
globalThis.__DEV__ !== false && invariant.warn(72);
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
19
|
switch (muteDeprecations("parser", function () { return parser(document).type; })) {
|
package/react/hoc/hoc-utils.js
CHANGED
|
@@ -36,7 +36,7 @@ var GraphQLBase = /** @class */ (function (_super) {
|
|
|
36
36
|
return _this;
|
|
37
37
|
}
|
|
38
38
|
GraphQLBase.prototype.getWrappedInstance = function () {
|
|
39
|
-
invariant(this.withRef,
|
|
39
|
+
invariant(this.withRef, 73);
|
|
40
40
|
return this.wrappedInstance;
|
|
41
41
|
};
|
|
42
42
|
GraphQLBase.prototype.setWrappedInstance = function (ref) {
|