@apollo/client 3.8.0-alpha.5 → 3.8.0-alpha.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/apollo-client.cjs +151 -72
- package/apollo-client.cjs.map +1 -1
- package/apollo-client.min.cjs +1 -1
- package/cache/cache.cjs +20 -20
- package/cache/cache.cjs.map +1 -1
- package/cache/cache.cjs.native.js +20 -20
- package/cache/core/cache.d.ts +1 -1
- package/cache/core/cache.d.ts.map +1 -1
- package/cache/core/cache.js.map +1 -1
- package/cache/core/types/common.d.ts +7 -7
- package/cache/core/types/common.d.ts.map +1 -1
- package/cache/inmemory/entityStore.d.ts +1 -1
- package/cache/inmemory/entityStore.d.ts.map +1 -1
- package/cache/inmemory/entityStore.js +1 -1
- package/cache/inmemory/helpers.js.map +1 -1
- package/cache/inmemory/inMemoryCache.d.ts +3 -2
- package/cache/inmemory/inMemoryCache.d.ts.map +1 -1
- package/cache/inmemory/inMemoryCache.js +1 -1
- package/cache/inmemory/inMemoryCache.js.map +1 -1
- package/cache/inmemory/key-extractor.js +1 -1
- package/cache/inmemory/object-canon.d.ts +0 -1
- package/cache/inmemory/object-canon.d.ts.map +1 -1
- package/cache/inmemory/object-canon.js +1 -1
- package/cache/inmemory/object-canon.js.map +1 -1
- package/cache/inmemory/policies.d.ts +12 -12
- package/cache/inmemory/policies.d.ts.map +1 -1
- package/cache/inmemory/policies.js +1 -1
- package/cache/inmemory/policies.js.map +1 -1
- package/cache/inmemory/reactiveVars.d.ts +1 -1
- package/cache/inmemory/reactiveVars.d.ts.map +1 -1
- package/cache/inmemory/readFromStore.d.ts +2 -2
- package/cache/inmemory/readFromStore.d.ts.map +1 -1
- package/cache/inmemory/readFromStore.js +1 -1
- package/cache/inmemory/readFromStore.js.map +1 -1
- package/cache/inmemory/types.d.ts +4 -4
- package/cache/inmemory/types.d.ts.map +1 -1
- package/cache/inmemory/writeToStore.d.ts +1 -1
- package/cache/inmemory/writeToStore.d.ts.map +1 -1
- package/cache/inmemory/writeToStore.js +1 -1
- package/cache/inmemory/writeToStore.js.map +1 -1
- package/core/ApolloClient.d.ts +5 -5
- package/core/ApolloClient.d.ts.map +1 -1
- package/core/ApolloClient.js +1 -1
- package/core/ApolloClient.js.map +1 -1
- package/core/LocalState.d.ts +9 -6
- package/core/LocalState.d.ts.map +1 -1
- package/core/LocalState.js +65 -15
- package/core/LocalState.js.map +1 -1
- package/core/ObservableQuery.d.ts +5 -5
- package/core/ObservableQuery.d.ts.map +1 -1
- package/core/ObservableQuery.js +2 -2
- package/core/ObservableQuery.js.map +1 -1
- package/core/QueryInfo.d.ts +1 -1
- package/core/QueryInfo.d.ts.map +1 -1
- package/core/QueryInfo.js +1 -1
- package/core/QueryInfo.js.map +1 -1
- package/core/QueryManager.d.ts +7 -7
- package/core/QueryManager.d.ts.map +1 -1
- package/core/QueryManager.js +19 -11
- package/core/QueryManager.js.map +1 -1
- package/core/core.cjs +113 -62
- package/core/core.cjs.map +1 -1
- package/core/core.cjs.native.js +113 -62
- package/core/index.js +2 -2
- package/core/index.js.map +1 -1
- package/core/types.d.ts +18 -17
- package/core/types.d.ts.map +1 -1
- package/core/types.js +1 -0
- package/core/types.js.map +1 -1
- package/core/watchQueryOptions.d.ts +11 -11
- package/core/watchQueryOptions.d.ts.map +1 -1
- package/core/watchQueryOptions.js.map +1 -1
- package/errors/index.d.ts +2 -2
- package/errors/index.d.ts.map +1 -1
- package/invariantErrorCodes.js +33 -33
- package/link/batch/batch.cjs +5 -3
- package/link/batch/batch.cjs.map +1 -1
- package/link/batch/batch.cjs.native.js +5 -3
- package/link/batch/batching.d.ts +2 -2
- package/link/batch/batching.d.ts.map +1 -1
- package/link/batch/batching.js +5 -3
- package/link/batch/batching.js.map +1 -1
- package/link/context/index.d.ts +2 -1
- package/link/context/index.d.ts.map +1 -1
- package/link/context/index.js.map +1 -1
- 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/core/types.d.ts +13 -12
- package/link/core/types.d.ts.map +1 -1
- package/link/core/types.js.map +1 -1
- package/link/http/checkFetcher.js +2 -2
- package/link/http/createHttpLink.d.ts +0 -1
- package/link/http/createHttpLink.d.ts.map +1 -1
- package/link/http/createHttpLink.js +2 -1
- package/link/http/createHttpLink.js.map +1 -1
- package/link/http/http.cjs +13 -38
- package/link/http/http.cjs.map +1 -1
- package/link/http/http.cjs.native.js +13 -38
- package/link/http/iterators/async.js.map +1 -1
- package/link/http/iterators/nodeStream.js.map +1 -1
- package/link/http/iterators/promise.js.map +1 -1
- package/link/http/iterators/reader.js.map +1 -1
- package/link/http/parseAndCheckHttpResponse.d.ts +2 -2
- package/link/http/parseAndCheckHttpResponse.d.ts.map +1 -1
- package/link/http/parseAndCheckHttpResponse.js.map +1 -1
- package/link/http/responseIterator.js +1 -1
- package/link/http/responseIterator.js.map +1 -1
- package/link/http/selectHttpOptionsAndBody.d.ts +2 -2
- package/link/http/selectHttpOptionsAndBody.d.ts.map +1 -1
- package/link/http/selectHttpOptionsAndBody.js +3 -1
- package/link/http/selectHttpOptionsAndBody.js.map +1 -1
- package/link/http/serializeFetchParameter.d.ts +1 -1
- package/link/http/serializeFetchParameter.d.ts.map +1 -1
- package/link/http/serializeFetchParameter.js +2 -2
- package/link/persisted-queries/index.d.ts +2 -2
- package/link/persisted-queries/index.d.ts.map +1 -1
- package/link/persisted-queries/index.js +3 -3
- package/link/persisted-queries/persisted-queries.cjs +3 -3
- package/link/persisted-queries/persisted-queries.cjs.map +1 -1
- package/link/persisted-queries/persisted-queries.cjs.native.js +3 -3
- package/link/utils/throwServerError.d.ts +1 -1
- package/link/utils/throwServerError.d.ts.map +1 -1
- 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 +2 -2
- package/package.json +15 -15
- package/react/cache/SuspenseCache.d.ts +1 -1
- package/react/cache/SuspenseCache.d.ts.map +1 -1
- package/react/cache/SuspenseCache.js.map +1 -1
- package/react/components/Query.d.ts +2 -2
- package/react/components/Query.d.ts.map +1 -1
- package/react/components/Query.js.map +1 -1
- package/react/components/Subscription.d.ts +2 -2
- package/react/components/Subscription.d.ts.map +1 -1
- package/react/components/Subscription.js.map +1 -1
- package/react/components/types.d.ts +2 -2
- package/react/components/types.d.ts.map +1 -1
- package/react/components/types.js.map +1 -1
- package/react/context/ApolloConsumer.js +2 -2
- package/react/context/ApolloProvider.js +2 -2
- 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.d.ts +2 -1
- package/react/hoc/graphql.d.ts.map +1 -1
- package/react/hoc/graphql.js.map +1 -1
- package/react/hoc/hoc-utils.d.ts +1 -1
- package/react/hoc/hoc-utils.d.ts.map +1 -1
- package/react/hoc/hoc-utils.js +2 -2
- package/react/hoc/hoc.cjs +4 -4
- package/react/hoc/hoc.cjs.map +1 -1
- package/react/hoc/hoc.cjs.native.js +4 -4
- package/react/hoc/mutation-hoc.d.ts +2 -2
- package/react/hoc/mutation-hoc.d.ts.map +1 -1
- package/react/hoc/mutation-hoc.js.map +1 -1
- package/react/hoc/query-hoc.d.ts +1 -1
- package/react/hoc/query-hoc.d.ts.map +1 -1
- package/react/hoc/query-hoc.js.map +1 -1
- package/react/hoc/subscription-hoc.d.ts +1 -1
- package/react/hoc/subscription-hoc.d.ts.map +1 -1
- package/react/hoc/subscription-hoc.js.map +1 -1
- package/react/hoc/types.d.ts +6 -6
- package/react/hoc/types.d.ts.map +1 -1
- package/react/hoc/types.js.map +1 -1
- package/react/hoc/withApollo.js +2 -2
- package/react/hooks/hooks.cjs +26 -32
- package/react/hooks/hooks.cjs.map +1 -1
- package/react/hooks/hooks.cjs.native.js +26 -32
- package/react/hooks/internal/useIsomorphicLayoutEffect.js +1 -1
- package/react/hooks/internal/useIsomorphicLayoutEffect.js.map +1 -1
- package/react/hooks/useApolloClient.js +2 -2
- package/react/hooks/useFragment.d.ts +4 -2
- package/react/hooks/useFragment.d.ts.map +1 -1
- package/react/hooks/useFragment.js +9 -8
- package/react/hooks/useFragment.js.map +1 -1
- package/react/hooks/useLazyQuery.d.ts +2 -2
- package/react/hooks/useLazyQuery.d.ts.map +1 -1
- package/react/hooks/useLazyQuery.js +3 -4
- package/react/hooks/useLazyQuery.js.map +1 -1
- package/react/hooks/useMutation.d.ts +2 -2
- package/react/hooks/useMutation.d.ts.map +1 -1
- package/react/hooks/useMutation.js.map +1 -1
- package/react/hooks/useQuery.d.ts +4 -4
- package/react/hooks/useQuery.d.ts.map +1 -1
- package/react/hooks/useQuery.js +1 -1
- package/react/hooks/useQuery.js.map +1 -1
- package/react/hooks/useSubscription.d.ts +2 -3
- package/react/hooks/useSubscription.d.ts.map +1 -1
- package/react/hooks/useSubscription.js +1 -2
- package/react/hooks/useSubscription.js.map +1 -1
- package/react/hooks/useSuspenseCache.js +2 -2
- package/react/hooks/useSuspenseQuery.d.ts +1 -1
- package/react/hooks/useSuspenseQuery.d.ts.map +1 -1
- package/react/hooks/useSuspenseQuery.js +2 -2
- package/react/hooks/useSuspenseQuery.js.map +1 -1
- package/react/hooks/useSyncExternalStore.d.ts +1 -1
- package/react/hooks/useSyncExternalStore.d.ts.map +1 -1
- package/react/hooks/useSyncExternalStore.js +1 -1
- package/react/hooks/useSyncExternalStore.js.map +1 -1
- package/react/parser/index.js +6 -6
- package/react/parser/parser.cjs +10 -10
- package/react/parser/parser.cjs.map +1 -1
- package/react/parser/parser.cjs.native.js +10 -10
- package/react/ssr/RenderPromises.d.ts +4 -4
- package/react/ssr/RenderPromises.d.ts.map +1 -1
- package/react/ssr/RenderPromises.js.map +1 -1
- package/react/ssr/getDataFromTree.d.ts +1 -1
- package/react/ssr/getDataFromTree.d.ts.map +1 -1
- package/react/types/types.d.ts +24 -23
- package/react/types/types.d.ts.map +1 -1
- package/react/types/types.js.map +1 -1
- package/testing/core/core.cjs +13 -3
- package/testing/core/core.cjs.map +1 -1
- package/testing/core/core.cjs.native.js +13 -3
- package/testing/core/index.d.ts +1 -1
- package/testing/core/index.d.ts.map +1 -1
- package/testing/core/index.js.map +1 -1
- package/testing/core/mocking/mockFetch.js.map +1 -1
- package/testing/core/mocking/mockLink.d.ts +8 -4
- package/testing/core/mocking/mockLink.d.ts.map +1 -1
- package/testing/core/mocking/mockLink.js +14 -4
- package/testing/core/mocking/mockLink.js.map +1 -1
- package/testing/core/mocking/mockQueryManager.d.ts +1 -1
- package/testing/core/mocking/mockQueryManager.d.ts.map +1 -1
- package/testing/core/mocking/mockQueryManager.js +3 -3
- package/testing/core/mocking/mockQueryManager.js.map +1 -1
- package/testing/core/mocking/mockWatchQuery.d.ts +1 -1
- package/testing/core/mocking/mockWatchQuery.d.ts.map +1 -1
- package/testing/core/mocking/mockWatchQuery.js +4 -5
- package/testing/core/mocking/mockWatchQuery.js.map +1 -1
- package/testing/core/observableToPromise.d.ts +2 -2
- package/testing/core/observableToPromise.d.ts.map +1 -1
- package/testing/core/observableToPromise.js.map +1 -1
- package/testing/react/MockedProvider.d.ts +1 -0
- package/testing/react/MockedProvider.d.ts.map +1 -1
- package/testing/react/MockedProvider.js +2 -2
- package/testing/react/MockedProvider.js.map +1 -1
- package/testing/testing.cjs +2 -2
- package/testing/testing.cjs.map +1 -1
- package/testing/testing.cjs.native.js +2 -2
- package/utilities/common/cloneDeep.js.map +1 -1
- package/utilities/common/errorHandling.d.ts +2 -2
- package/utilities/common/errorHandling.d.ts.map +1 -1
- package/utilities/common/errorHandling.js.map +1 -1
- package/utilities/common/incrementalResult.d.ts +4 -4
- package/utilities/common/incrementalResult.d.ts.map +1 -1
- package/utilities/common/incrementalResult.js.map +1 -1
- package/utilities/common/maybeDeepFreeze.d.ts +0 -1
- package/utilities/common/maybeDeepFreeze.d.ts.map +1 -1
- package/utilities/common/maybeDeepFreeze.js +1 -1
- package/utilities/common/maybeDeepFreeze.js.map +1 -1
- package/utilities/common/mergeDeep.d.ts +2 -2
- package/utilities/common/mergeDeep.d.ts.map +1 -1
- package/utilities/common/mergeOptions.d.ts +3 -3
- package/utilities/common/mergeOptions.d.ts.map +1 -1
- package/utilities/common/mergeOptions.js.map +1 -1
- package/utilities/globals/DEV.d.ts +1 -1
- package/utilities/globals/DEV.d.ts.map +1 -1
- package/utilities/globals/DEV.js +1 -17
- package/utilities/globals/DEV.js.map +1 -1
- package/utilities/globals/global.d.ts +5 -2
- package/utilities/globals/global.d.ts.map +1 -1
- package/utilities/globals/global.js.map +1 -1
- package/utilities/globals/globals.cjs +5 -22
- package/utilities/globals/globals.cjs.map +1 -1
- package/utilities/globals/globals.cjs.native.js +5 -22
- package/utilities/globals/index.d.ts +1 -1
- package/utilities/globals/index.d.ts.map +1 -1
- package/utilities/globals/index.js +1 -4
- package/utilities/globals/index.js.map +1 -1
- package/utilities/graphql/directives.d.ts +2 -2
- package/utilities/graphql/directives.d.ts.map +1 -1
- package/utilities/graphql/directives.js +1 -1
- package/utilities/graphql/directives.js.map +1 -1
- package/utilities/graphql/fragments.d.ts +1 -1
- package/utilities/graphql/fragments.d.ts.map +1 -1
- package/utilities/graphql/fragments.js +1 -1
- package/utilities/graphql/getFromAST.js +1 -1
- package/utilities/graphql/storeUtils.d.ts +3 -3
- package/utilities/graphql/storeUtils.d.ts.map +1 -1
- package/utilities/graphql/storeUtils.js +1 -1
- package/utilities/graphql/storeUtils.js.map +1 -1
- package/utilities/graphql/transform.d.ts +9 -9
- package/utilities/graphql/transform.d.ts.map +1 -1
- package/utilities/graphql/transform.js +1 -1
- package/utilities/graphql/transform.js.map +1 -1
- package/utilities/index.d.ts +2 -0
- package/utilities/index.d.ts.map +1 -1
- package/utilities/index.js +2 -0
- package/utilities/index.js.map +1 -1
- package/utilities/observables/Concast.d.ts +5 -5
- package/utilities/observables/Concast.d.ts.map +1 -1
- package/utilities/observables/asyncMap.js.map +1 -1
- package/utilities/policies/pagination.d.ts +7 -7
- package/utilities/policies/pagination.d.ts.map +1 -1
- package/utilities/policies/pagination.js.map +1 -1
- package/utilities/types/IsStrictlyAny.d.ts +3 -3
- package/utilities/types/IsStrictlyAny.d.ts.map +1 -1
- package/utilities/utilities.cjs +75 -19
- package/utilities/utilities.cjs.map +1 -1
- package/utilities/utilities.cjs.native.js +75 -19
- package/version.js +1 -1
package/cache/cache.cjs
CHANGED
|
@@ -289,7 +289,7 @@ exports.EntityStore = (function () {
|
|
|
289
289
|
: newer;
|
|
290
290
|
if (!incoming)
|
|
291
291
|
return;
|
|
292
|
-
__DEV__ ? globals.invariant(typeof dataId === "string", "store.merge expects a string ID") : globals.invariant(typeof dataId === "string", 1);
|
|
292
|
+
globals.__DEV__ ? globals.invariant(typeof dataId === "string", "store.merge expects a string ID") : globals.invariant(typeof dataId === "string", 1);
|
|
293
293
|
var merged = new utilities.DeepMerger(storeObjectReconciler).merge(existing, incoming);
|
|
294
294
|
this.data[dataId] = merged;
|
|
295
295
|
if (merged !== existing) {
|
|
@@ -704,7 +704,7 @@ var ObjectCanon = (function () {
|
|
|
704
704
|
var node = this.pool.lookupArray(array);
|
|
705
705
|
if (!node.array) {
|
|
706
706
|
this.known.add(node.array = array);
|
|
707
|
-
if (__DEV__) {
|
|
707
|
+
if (globals.__DEV__) {
|
|
708
708
|
Object.freeze(array);
|
|
709
709
|
}
|
|
710
710
|
}
|
|
@@ -729,7 +729,7 @@ var ObjectCanon = (function () {
|
|
|
729
729
|
keys.sorted.forEach(function (key, i) {
|
|
730
730
|
obj_1[key] = array_1[firstValueIndex_1 + i];
|
|
731
731
|
});
|
|
732
|
-
if (__DEV__) {
|
|
732
|
+
if (globals.__DEV__) {
|
|
733
733
|
Object.freeze(obj_1);
|
|
734
734
|
}
|
|
735
735
|
}
|
|
@@ -944,7 +944,7 @@ var StoreReader = (function () {
|
|
|
944
944
|
else {
|
|
945
945
|
var fragment = utilities.getFragmentFromSelection(selection, context.lookupFragment);
|
|
946
946
|
if (!fragment && selection.kind === graphql.Kind.FRAGMENT_SPREAD) {
|
|
947
|
-
throw __DEV__ ? new globals.InvariantError("No fragment named ".concat(selection.name.value)) : new globals.InvariantError(5);
|
|
947
|
+
throw globals.__DEV__ ? new globals.InvariantError("No fragment named ".concat(selection.name.value)) : new globals.InvariantError(5);
|
|
948
948
|
}
|
|
949
949
|
if (fragment && policies.fragmentMatches(fragment, typename)) {
|
|
950
950
|
fragment.selectionSet.selections.forEach(workSet.add, workSet);
|
|
@@ -996,7 +996,7 @@ var StoreReader = (function () {
|
|
|
996
996
|
context: context,
|
|
997
997
|
}), i);
|
|
998
998
|
}
|
|
999
|
-
if (__DEV__) {
|
|
999
|
+
if (globals.__DEV__) {
|
|
1000
1000
|
assertSelectionSetForIdValue(context.store, field, item);
|
|
1001
1001
|
}
|
|
1002
1002
|
return item;
|
|
@@ -1025,7 +1025,7 @@ function assertSelectionSetForIdValue(store, field, fieldValue) {
|
|
|
1025
1025
|
var workSet_1 = new Set([fieldValue]);
|
|
1026
1026
|
workSet_1.forEach(function (value) {
|
|
1027
1027
|
if (utilities.isNonNullObject(value)) {
|
|
1028
|
-
__DEV__ ? globals.invariant(!utilities.isReference(value), "Missing selection set for object of type ".concat(getTypenameFromStoreObject(store, value), " returned for query field ").concat(field.name.value)) : globals.invariant(!utilities.isReference(value), 6);
|
|
1028
|
+
globals.__DEV__ ? globals.invariant(!utilities.isReference(value), "Missing selection set for object of type ".concat(getTypenameFromStoreObject(store, value), " returned for query field ").concat(field.name.value)) : globals.invariant(!utilities.isReference(value), 6);
|
|
1029
1029
|
Object.values(value).forEach(workSet_1.add, workSet_1);
|
|
1030
1030
|
}
|
|
1031
1031
|
});
|
|
@@ -1112,7 +1112,7 @@ function keyFieldsFnFromSpecifier(specifier) {
|
|
|
1112
1112
|
hasOwn.call(object, schemaKeyPath[0])) {
|
|
1113
1113
|
extracted = extractKeyPath(object, schemaKeyPath, extractKey);
|
|
1114
1114
|
}
|
|
1115
|
-
__DEV__ ? globals.invariant(extracted !== void 0, "Missing field '".concat(schemaKeyPath.join('.'), "' while extracting keyFields from ").concat(JSON.stringify(object))) : globals.invariant(extracted !== void 0, 2);
|
|
1115
|
+
globals.__DEV__ ? globals.invariant(extracted !== void 0, "Missing field '".concat(schemaKeyPath.join('.'), "' while extracting keyFields from ").concat(JSON.stringify(object))) : globals.invariant(extracted !== void 0, 2);
|
|
1116
1116
|
return extracted;
|
|
1117
1117
|
});
|
|
1118
1118
|
return "".concat(context.typename, ":").concat(JSON.stringify(keyObject));
|
|
@@ -1341,7 +1341,7 @@ var Policies = (function () {
|
|
|
1341
1341
|
var rootId = "ROOT_" + which.toUpperCase();
|
|
1342
1342
|
var old = this.rootTypenamesById[rootId];
|
|
1343
1343
|
if (typename !== old) {
|
|
1344
|
-
__DEV__ ? globals.invariant(!old || old === which, "Cannot change root ".concat(which, " __typename more than once")) : globals.invariant(!old || old === which, 3);
|
|
1344
|
+
globals.__DEV__ ? globals.invariant(!old || old === which, "Cannot change root ".concat(which, " __typename more than once")) : globals.invariant(!old || old === which, 3);
|
|
1345
1345
|
if (old)
|
|
1346
1346
|
delete this.rootIdsByTypename[old];
|
|
1347
1347
|
this.rootIdsByTypename[typename] = rootId;
|
|
@@ -1425,7 +1425,7 @@ var Policies = (function () {
|
|
|
1425
1425
|
if (supertypeSet.has(supertype)) {
|
|
1426
1426
|
if (!typenameSupertypeSet.has(supertype)) {
|
|
1427
1427
|
if (checkingFuzzySubtypes) {
|
|
1428
|
-
__DEV__ && globals.invariant.warn("Inferring subtype ".concat(typename, " of supertype ").concat(supertype));
|
|
1428
|
+
globals.__DEV__ && globals.invariant.warn("Inferring subtype ".concat(typename, " of supertype ").concat(supertype));
|
|
1429
1429
|
}
|
|
1430
1430
|
typenameSupertypeSet.add(supertype);
|
|
1431
1431
|
}
|
|
@@ -1578,8 +1578,8 @@ function normalizeReadFieldOptions(readFieldArgs, objectOrReference, variables)
|
|
|
1578
1578
|
options.from = objectOrReference;
|
|
1579
1579
|
}
|
|
1580
1580
|
}
|
|
1581
|
-
if (__DEV__ && options.from === void 0) {
|
|
1582
|
-
__DEV__ && globals.invariant.warn("Undefined 'from' passed to readField with arguments ".concat(utilities.stringifyForDisplay(Array.from(readFieldArgs))));
|
|
1581
|
+
if (globals.__DEV__ && options.from === void 0) {
|
|
1582
|
+
globals.__DEV__ && globals.invariant.warn("Undefined 'from' passed to readField with arguments ".concat(utilities.stringifyForDisplay(Array.from(readFieldArgs))));
|
|
1583
1583
|
}
|
|
1584
1584
|
if (void 0 === options.variables) {
|
|
1585
1585
|
options.variables = variables;
|
|
@@ -1589,7 +1589,7 @@ function normalizeReadFieldOptions(readFieldArgs, objectOrReference, variables)
|
|
|
1589
1589
|
function makeMergeObjectsFunction(store) {
|
|
1590
1590
|
return function mergeObjects(existing, incoming) {
|
|
1591
1591
|
if (isArray(existing) || isArray(incoming)) {
|
|
1592
|
-
throw __DEV__ ? new globals.InvariantError("Cannot automatically merge arrays") : new globals.InvariantError(4);
|
|
1592
|
+
throw globals.__DEV__ ? new globals.InvariantError("Cannot automatically merge arrays") : new globals.InvariantError(4);
|
|
1593
1593
|
}
|
|
1594
1594
|
if (utilities.isNonNullObject(existing) &&
|
|
1595
1595
|
utilities.isNonNullObject(incoming)) {
|
|
@@ -1650,7 +1650,7 @@ var StoreWriter = (function () {
|
|
|
1650
1650
|
context: context,
|
|
1651
1651
|
});
|
|
1652
1652
|
if (!utilities.isReference(ref)) {
|
|
1653
|
-
throw __DEV__ ? new globals.InvariantError("Could not identify object ".concat(JSON.stringify(result))) : new globals.InvariantError(7);
|
|
1653
|
+
throw globals.__DEV__ ? new globals.InvariantError("Could not identify object ".concat(JSON.stringify(result))) : new globals.InvariantError(7);
|
|
1654
1654
|
}
|
|
1655
1655
|
context.incomingById.forEach(function (_a, dataId) {
|
|
1656
1656
|
var storeObject = _a.storeObject, mergeTree = _a.mergeTree, fieldNodeSet = _a.fieldNodeSet;
|
|
@@ -1662,7 +1662,7 @@ var StoreWriter = (function () {
|
|
|
1662
1662
|
}
|
|
1663
1663
|
storeObject = applied;
|
|
1664
1664
|
}
|
|
1665
|
-
if (__DEV__ && !context.overwrite) {
|
|
1665
|
+
if (globals.__DEV__ && !context.overwrite) {
|
|
1666
1666
|
var fieldsWithSelectionSets_1 = Object.create(null);
|
|
1667
1667
|
fieldNodeSet.forEach(function (field) {
|
|
1668
1668
|
if (field.selectionSet) {
|
|
@@ -1750,12 +1750,12 @@ var StoreWriter = (function () {
|
|
|
1750
1750
|
_a[storeFieldName] = incomingValue,
|
|
1751
1751
|
_a));
|
|
1752
1752
|
}
|
|
1753
|
-
else if (__DEV__ &&
|
|
1753
|
+
else if (globals.__DEV__ &&
|
|
1754
1754
|
!context.clientOnly &&
|
|
1755
1755
|
!context.deferred &&
|
|
1756
1756
|
!utilities.addTypenameToDocument.added(field) &&
|
|
1757
1757
|
!policies.getReadFunction(typename, field.name.value)) {
|
|
1758
|
-
__DEV__ && globals.invariant.error("Missing field '".concat(utilities.resultKeyNameFromField(field), "' while writing result ").concat(JSON.stringify(result, null, 2)).substring(0, 1000));
|
|
1758
|
+
globals.__DEV__ && globals.invariant.error("Missing field '".concat(utilities.resultKeyNameFromField(field), "' while writing result ").concat(JSON.stringify(result, null, 2)).substring(0, 1000));
|
|
1759
1759
|
}
|
|
1760
1760
|
});
|
|
1761
1761
|
try {
|
|
@@ -1804,7 +1804,7 @@ var StoreWriter = (function () {
|
|
|
1804
1804
|
StoreWriter.prototype.processFieldValue = function (value, field, context, mergeTree) {
|
|
1805
1805
|
var _this = this;
|
|
1806
1806
|
if (!field.selectionSet || value === null) {
|
|
1807
|
-
return __DEV__ ? utilities.cloneDeep(value) : value;
|
|
1807
|
+
return globals.__DEV__ ? utilities.cloneDeep(value) : value;
|
|
1808
1808
|
}
|
|
1809
1809
|
if (isArray(value)) {
|
|
1810
1810
|
return value.map(function (item, i) {
|
|
@@ -1859,7 +1859,7 @@ var StoreWriter = (function () {
|
|
|
1859
1859
|
else {
|
|
1860
1860
|
var fragment = utilities.getFragmentFromSelection(selection, context.lookupFragment);
|
|
1861
1861
|
if (!fragment && selection.kind === graphql.Kind.FRAGMENT_SPREAD) {
|
|
1862
|
-
throw __DEV__ ? new globals.InvariantError("No fragment named ".concat(selection.name.value)) : new globals.InvariantError(8);
|
|
1862
|
+
throw globals.__DEV__ ? new globals.InvariantError("No fragment named ".concat(selection.name.value)) : new globals.InvariantError(8);
|
|
1863
1863
|
}
|
|
1864
1864
|
if (fragment &&
|
|
1865
1865
|
policies.fragmentMatches(fragment, typename, result, context.variables)) {
|
|
@@ -1995,7 +1995,7 @@ function warnAboutDataLoss(existingRef, incomingObj, storeFieldName, store) {
|
|
|
1995
1995
|
}
|
|
1996
1996
|
});
|
|
1997
1997
|
}
|
|
1998
|
-
__DEV__ && globals.invariant.warn("Cache data may be lost when replacing the ".concat(fieldName, " field of a ").concat(parentType, " object.\n\nTo address this problem (which is not a bug in Apollo Client), ").concat(childTypenames.length
|
|
1998
|
+
globals.__DEV__ && globals.invariant.warn("Cache data may be lost when replacing the ".concat(fieldName, " field of a ").concat(parentType, " object.\n\nTo address this problem (which is not a bug in Apollo Client), ").concat(childTypenames.length
|
|
1999
1999
|
? "either ensure all objects of type " +
|
|
2000
2000
|
childTypenames.join(" and ") + " have an ID or a custom merge function, or "
|
|
2001
2001
|
: "", "define a custom merge function for the ").concat(typeDotName, " field, so InMemoryCache can safely merge these objects:\n\n existing: ").concat(JSON.stringify(existing).slice(0, 1000), "\n incoming: ").concat(JSON.stringify(incoming).slice(0, 1000), "\n\nFor more information about these options, please refer to the documentation:\n\n * Ensuring entity objects have IDs: https://go.apollo.dev/c/generating-unique-identifiers\n * Defining custom merge functions: https://go.apollo.dev/c/merging-non-normalized-objects\n"));
|
|
@@ -2155,7 +2155,7 @@ var InMemoryCache = (function (_super) {
|
|
|
2155
2155
|
return this.policies.identify(object)[0];
|
|
2156
2156
|
}
|
|
2157
2157
|
catch (e) {
|
|
2158
|
-
__DEV__ && globals.invariant.warn(e);
|
|
2158
|
+
globals.__DEV__ && globals.invariant.warn(e);
|
|
2159
2159
|
}
|
|
2160
2160
|
};
|
|
2161
2161
|
InMemoryCache.prototype.evict = function (options) {
|