@apollo/client 3.4.9 → 3.4.10
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/apollo-client.cjs.js +24 -52
- package/apollo-client.cjs.js.map +1 -1
- package/apollo-core.cjs.js +22 -16
- package/apollo-core.cjs.js.map +1 -1
- package/apollo-core.cjs.min.js +1 -1
- package/cache/cache.cjs.js +20 -22
- package/cache/cache.cjs.js.map +1 -1
- package/cache/index.d.ts +1 -0
- package/cache/index.d.ts.map +1 -1
- package/cache/index.js +1 -2
- package/cache/index.js.map +1 -1
- package/cache/inmemory/entityStore.js +1 -1
- package/cache/inmemory/entityStore.js.map +1 -1
- package/cache/inmemory/object-canon.d.ts +1 -0
- package/cache/inmemory/object-canon.d.ts.map +1 -1
- package/cache/inmemory/object-canon.js +1 -0
- package/cache/inmemory/object-canon.js.map +1 -1
- 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/readFromStore.d.ts.map +1 -1
- package/cache/inmemory/readFromStore.js +1 -1
- package/cache/inmemory/readFromStore.js.map +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.map +1 -1
- package/core/ApolloClient.js +1 -1
- package/core/ApolloClient.js.map +1 -1
- package/core/LocalState.d.ts.map +1 -1
- package/core/LocalState.js +1 -1
- package/core/LocalState.js.map +1 -1
- package/core/ObservableQuery.d.ts.map +1 -1
- package/core/ObservableQuery.js +18 -5
- package/core/ObservableQuery.js.map +1 -1
- package/core/QueryManager.d.ts.map +1 -1
- package/core/QueryManager.js +1 -1
- package/core/QueryManager.js.map +1 -1
- package/core/core.cjs.js +47 -34
- package/core/core.cjs.js.map +1 -1
- package/core/index.d.ts.map +1 -1
- package/core/index.js +1 -2
- package/core/index.js.map +1 -1
- package/errors/errors.cjs.js +1 -1
- package/errors/errors.cjs.js.map +1 -1
- package/errors/index.d.ts +1 -0
- package/errors/index.d.ts.map +1 -1
- package/errors/index.js +1 -2
- package/errors/index.js.map +1 -1
- package/invariantErrorCodes.js +1 -1
- package/link/core/ApolloLink.js +1 -1
- package/link/core/ApolloLink.js.map +1 -1
- package/link/core/core.cjs.js +4 -6
- package/link/core/core.cjs.js.map +1 -1
- package/link/core/index.d.ts +1 -0
- package/link/core/index.d.ts.map +1 -1
- package/link/core/index.js +1 -2
- package/link/core/index.js.map +1 -1
- package/link/http/checkFetcher.js +1 -1
- package/link/http/checkFetcher.js.map +1 -1
- package/link/http/createHttpLink.d.ts +1 -0
- package/link/http/createHttpLink.d.ts.map +1 -1
- package/link/http/createHttpLink.js +1 -0
- package/link/http/createHttpLink.js.map +1 -1
- package/link/http/http.cjs.js +4 -6
- package/link/http/http.cjs.js.map +1 -1
- package/link/http/index.d.ts +1 -0
- package/link/http/index.d.ts.map +1 -1
- package/link/http/index.js +1 -2
- package/link/http/index.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 +1 -1
- package/link/http/serializeFetchParameter.js.map +1 -1
- package/link/persisted-queries/index.d.ts.map +1 -1
- package/link/persisted-queries/index.js +1 -3
- package/link/persisted-queries/index.js.map +1 -1
- package/link/persisted-queries/persisted-queries.cjs.js +5 -6
- package/link/persisted-queries/persisted-queries.cjs.js.map +1 -1
- package/link/utils/index.d.ts +1 -0
- package/link/utils/index.d.ts.map +1 -1
- package/link/utils/index.js +1 -2
- package/link/utils/index.js.map +1 -1
- package/link/utils/toPromise.d.ts.map +1 -1
- package/link/utils/toPromise.js +1 -1
- package/link/utils/toPromise.js.map +1 -1
- package/link/utils/utils.cjs.js +3 -5
- package/link/utils/utils.cjs.js.map +1 -1
- package/link/utils/validateOperation.d.ts.map +1 -1
- package/link/utils/validateOperation.js +1 -1
- package/link/utils/validateOperation.js.map +1 -1
- package/package.json +1 -1
- package/react/context/ApolloConsumer.d.ts.map +1 -1
- package/react/context/ApolloConsumer.js +1 -1
- package/react/context/ApolloConsumer.js.map +1 -1
- package/react/context/ApolloProvider.d.ts.map +1 -1
- package/react/context/ApolloProvider.js +1 -1
- package/react/context/ApolloProvider.js.map +1 -1
- package/react/context/context.cjs.js +6 -8
- package/react/context/context.cjs.js.map +1 -1
- package/react/context/index.d.ts +1 -0
- package/react/context/index.d.ts.map +1 -1
- package/react/context/index.js +1 -2
- package/react/context/index.js.map +1 -1
- package/react/data/OperationData.d.ts.map +1 -1
- package/react/data/OperationData.js +1 -1
- package/react/data/OperationData.js.map +1 -1
- package/react/data/QueryData.d.ts.map +1 -1
- package/react/data/QueryData.js +1 -3
- package/react/data/QueryData.js.map +1 -1
- package/react/data/data.cjs.js +6 -11
- package/react/data/data.cjs.js.map +1 -1
- package/react/data/index.d.ts +1 -0
- package/react/data/index.d.ts.map +1 -1
- package/react/data/index.js +1 -2
- package/react/data/index.js.map +1 -1
- package/react/hoc/hoc-utils.d.ts.map +1 -1
- package/react/hoc/hoc-utils.js +1 -1
- package/react/hoc/hoc-utils.js.map +1 -1
- package/react/hoc/hoc.cjs.js +5 -8
- package/react/hoc/hoc.cjs.js.map +1 -1
- package/react/hoc/index.d.ts +1 -0
- package/react/hoc/index.d.ts.map +1 -1
- package/react/hoc/index.js +1 -2
- package/react/hoc/index.js.map +1 -1
- package/react/hoc/withApollo.d.ts.map +1 -1
- package/react/hoc/withApollo.js +1 -1
- package/react/hoc/withApollo.js.map +1 -1
- package/react/hooks/hooks.cjs.js +3 -6
- package/react/hooks/hooks.cjs.js.map +1 -1
- package/react/hooks/index.d.ts +1 -0
- package/react/hooks/index.d.ts.map +1 -1
- package/react/hooks/index.js +1 -2
- package/react/hooks/index.js.map +1 -1
- package/react/hooks/useApolloClient.d.ts.map +1 -1
- package/react/hooks/useApolloClient.js +1 -1
- package/react/hooks/useApolloClient.js.map +1 -1
- package/react/hooks/useSubscription.d.ts +1 -0
- package/react/hooks/useSubscription.d.ts.map +1 -1
- package/react/hooks/useSubscription.js +1 -0
- package/react/hooks/useSubscription.js.map +1 -1
- package/react/hooks/utils/useAfterFastRefresh.d.ts +1 -0
- package/react/hooks/utils/useAfterFastRefresh.d.ts.map +1 -1
- package/react/hooks/utils/useAfterFastRefresh.js +1 -0
- package/react/hooks/utils/useAfterFastRefresh.js.map +1 -1
- package/react/hooks/utils/useBaseQuery.d.ts +1 -0
- package/react/hooks/utils/useBaseQuery.d.ts.map +1 -1
- package/react/hooks/utils/useBaseQuery.js +1 -0
- package/react/hooks/utils/useBaseQuery.js.map +1 -1
- package/react/index.d.ts +1 -0
- package/react/index.d.ts.map +1 -1
- package/react/index.js +1 -2
- package/react/index.js.map +1 -1
- package/react/parser/index.d.ts.map +1 -1
- package/react/parser/index.js +1 -3
- package/react/parser/index.js.map +1 -1
- package/react/parser/parser.cjs.js +9 -11
- package/react/parser/parser.cjs.js.map +1 -1
- package/react/react.cjs.js +2 -2
- package/react/react.cjs.js.map +1 -1
- package/testing/index.d.ts +1 -0
- package/testing/index.d.ts.map +1 -1
- package/testing/index.js +1 -2
- package/testing/index.js.map +1 -1
- package/testing/testing.cjs.js +3 -5
- package/testing/testing.cjs.js.map +1 -1
- package/utilities/globals/DEV.js +2 -2
- package/utilities/globals/DEV.js.map +1 -1
- package/utilities/{common → globals}/global.d.ts +0 -0
- package/utilities/globals/global.d.ts.map +1 -0
- package/utilities/{common → globals}/global.js +0 -0
- package/utilities/globals/global.js.map +1 -0
- package/utilities/globals/globals.cjs.js +56 -0
- package/utilities/globals/globals.cjs.js.map +1 -0
- package/utilities/globals/index.d.ts +4 -2
- package/utilities/globals/index.d.ts.map +1 -1
- package/utilities/globals/index.js +4 -2
- package/utilities/globals/index.js.map +1 -1
- package/utilities/{common → globals}/maybe.d.ts +0 -0
- package/utilities/globals/maybe.d.ts.map +1 -0
- package/utilities/{common → globals}/maybe.js +0 -0
- package/utilities/globals/maybe.js.map +1 -0
- package/utilities/globals/package.json +7 -0
- 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.map +1 -1
- package/utilities/graphql/fragments.js +1 -1
- package/utilities/graphql/fragments.js.map +1 -1
- package/utilities/graphql/getFromAST.d.ts.map +1 -1
- package/utilities/graphql/getFromAST.js +1 -1
- package/utilities/graphql/getFromAST.js.map +1 -1
- 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.map +1 -1
- package/utilities/graphql/transform.js +1 -1
- package/utilities/graphql/transform.js.map +1 -1
- package/utilities/index.d.ts +1 -3
- package/utilities/index.d.ts.map +1 -1
- package/utilities/index.js +1 -4
- package/utilities/index.js.map +1 -1
- package/utilities/package.json +1 -3
- package/utilities/testing/mocking/mockLink.d.ts.map +1 -1
- package/utilities/testing/mocking/mockLink.js +1 -1
- package/utilities/testing/mocking/mockLink.js.map +1 -1
- package/utilities/utilities.cjs.js +23 -68
- package/utilities/utilities.cjs.js.map +1 -1
- package/version.js +1 -1
- package/utilities/common/global.d.ts.map +0 -1
- package/utilities/common/global.js.map +0 -1
- package/utilities/common/maybe.d.ts.map +0 -1
- package/utilities/common/maybe.js.map +0 -1
package/apollo-core.cjs.js
CHANGED
|
@@ -50,9 +50,6 @@ function removeTemporaryGlobals() {
|
|
|
50
50
|
return process$1.remove();
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
function checkDEV() {
|
|
54
|
-
__DEV__ ? tsInvariant.invariant("boolean" === typeof DEV, DEV) : tsInvariant.invariant("boolean" === typeof DEV, 38);
|
|
55
|
-
}
|
|
56
53
|
removeTemporaryGlobals();
|
|
57
54
|
|
|
58
55
|
function shouldInclude(_a, variables) {
|
|
@@ -723,7 +720,7 @@ function removeClientSetsFromDocument(document) {
|
|
|
723
720
|
return modifiedDoc;
|
|
724
721
|
}
|
|
725
722
|
|
|
726
|
-
var hasOwnProperty$
|
|
723
|
+
var hasOwnProperty$3 = Object.prototype.hasOwnProperty;
|
|
727
724
|
function mergeDeep() {
|
|
728
725
|
var sources = [];
|
|
729
726
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
@@ -760,7 +757,7 @@ var DeepMerger = (function () {
|
|
|
760
757
|
}
|
|
761
758
|
if (isNonNullObject(source) && isNonNullObject(target)) {
|
|
762
759
|
Object.keys(source).forEach(function (sourceKey) {
|
|
763
|
-
if (hasOwnProperty$
|
|
760
|
+
if (hasOwnProperty$3.call(target, sourceKey)) {
|
|
764
761
|
var targetValue = target[sourceKey];
|
|
765
762
|
if (source[sourceKey] !== targetValue) {
|
|
766
763
|
var result = _this.reconciler.apply(_this, tslib.__spreadArray([target, source, sourceKey], context));
|
|
@@ -1089,8 +1086,6 @@ function stringifyForDisplay(value) {
|
|
|
1089
1086
|
}).split(JSON.stringify(undefId)).join("<undefined>");
|
|
1090
1087
|
}
|
|
1091
1088
|
|
|
1092
|
-
checkDEV();
|
|
1093
|
-
|
|
1094
1089
|
function fromError(errorValue) {
|
|
1095
1090
|
return new zenObservableTs.Observable(function (observer) {
|
|
1096
1091
|
observer.error(errorValue);
|
|
@@ -1295,9 +1290,9 @@ var concat = ApolloLink.concat;
|
|
|
1295
1290
|
|
|
1296
1291
|
var execute = ApolloLink.execute;
|
|
1297
1292
|
|
|
1298
|
-
var version = '3.4.
|
|
1293
|
+
var version = '3.4.10';
|
|
1299
1294
|
|
|
1300
|
-
var hasOwnProperty$
|
|
1295
|
+
var hasOwnProperty$2 = Object.prototype.hasOwnProperty;
|
|
1301
1296
|
function parseAndCheckHttpResponse(operations) {
|
|
1302
1297
|
return function (response) { return response
|
|
1303
1298
|
.text()
|
|
@@ -1319,8 +1314,8 @@ function parseAndCheckHttpResponse(operations) {
|
|
|
1319
1314
|
throwServerError(response, result, "Response not successful: Received status code " + response.status);
|
|
1320
1315
|
}
|
|
1321
1316
|
if (!Array.isArray(result) &&
|
|
1322
|
-
!hasOwnProperty$
|
|
1323
|
-
!hasOwnProperty$
|
|
1317
|
+
!hasOwnProperty$2.call(result, 'data') &&
|
|
1318
|
+
!hasOwnProperty$2.call(result, 'errors')) {
|
|
1324
1319
|
throwServerError(response, result, "Server response was missing for query '" + (Array.isArray(operations)
|
|
1325
1320
|
? operations.map(function (op) { return op.operationName; })
|
|
1326
1321
|
: operations.operationName) + "'.");
|
|
@@ -3675,7 +3670,6 @@ var InMemoryCache = (function (_super) {
|
|
|
3675
3670
|
return InMemoryCache;
|
|
3676
3671
|
}(ApolloCache));
|
|
3677
3672
|
|
|
3678
|
-
checkDEV();
|
|
3679
3673
|
function isApolloError(err) {
|
|
3680
3674
|
return err.hasOwnProperty('graphQLErrors');
|
|
3681
3675
|
}
|
|
@@ -3727,6 +3721,7 @@ function isNetworkRequestInFlight(networkStatus) {
|
|
|
3727
3721
|
return networkStatus ? networkStatus < 7 : false;
|
|
3728
3722
|
}
|
|
3729
3723
|
|
|
3724
|
+
var assign = Object.assign, hasOwnProperty$1 = Object.hasOwnProperty;
|
|
3730
3725
|
var warnedAboutUpdateQuery = false;
|
|
3731
3726
|
var ObservableQuery = (function (_super) {
|
|
3732
3727
|
tslib.__extends(ObservableQuery, _super);
|
|
@@ -3803,7 +3798,12 @@ var ObservableQuery = (function (_super) {
|
|
|
3803
3798
|
(lastResult && lastResult.networkStatus) ||
|
|
3804
3799
|
exports.NetworkStatus.ready;
|
|
3805
3800
|
var result = tslib.__assign(tslib.__assign({}, lastResult), { loading: isNetworkRequestInFlight(networkStatus), networkStatus: networkStatus });
|
|
3806
|
-
|
|
3801
|
+
var _a = this.options.fetchPolicy, fetchPolicy = _a === void 0 ? "cache-first" : _a;
|
|
3802
|
+
var shouldReturnCachedData = lastResult || (fetchPolicy !== 'network-only' &&
|
|
3803
|
+
fetchPolicy !== 'no-cache' &&
|
|
3804
|
+
fetchPolicy !== 'standby');
|
|
3805
|
+
if (shouldReturnCachedData &&
|
|
3806
|
+
!this.queryManager.transform(this.options.query).hasForcedResolvers) {
|
|
3807
3807
|
var diff = this.queryInfo.getDiff();
|
|
3808
3808
|
if (diff.complete || this.options.returnPartialData) {
|
|
3809
3809
|
result.data = diff.result;
|
|
@@ -3811,7 +3811,6 @@ var ObservableQuery = (function (_super) {
|
|
|
3811
3811
|
if (equality.equal(result.data, {})) {
|
|
3812
3812
|
result.data = void 0;
|
|
3813
3813
|
}
|
|
3814
|
-
var _a = this.options.fetchPolicy, fetchPolicy = _a === void 0 ? "cache-first" : _a;
|
|
3815
3814
|
if (diff.complete) {
|
|
3816
3815
|
if (result.networkStatus === exports.NetworkStatus.loading &&
|
|
3817
3816
|
(fetchPolicy === 'cache-first' ||
|
|
@@ -3863,6 +3862,7 @@ var ObservableQuery = (function (_super) {
|
|
|
3863
3862
|
this.queryManager.resetErrors(this.queryId);
|
|
3864
3863
|
};
|
|
3865
3864
|
ObservableQuery.prototype.refetch = function (variables) {
|
|
3865
|
+
var _a;
|
|
3866
3866
|
var reobserveOptions = {
|
|
3867
3867
|
pollInterval: 0,
|
|
3868
3868
|
};
|
|
@@ -3873,6 +3873,13 @@ var ObservableQuery = (function (_super) {
|
|
|
3873
3873
|
else if (fetchPolicy !== 'cache-and-network') {
|
|
3874
3874
|
reobserveOptions.fetchPolicy = 'network-only';
|
|
3875
3875
|
}
|
|
3876
|
+
if (__DEV__ && variables && hasOwnProperty$1.call(variables, "variables")) {
|
|
3877
|
+
var queryDef = getQueryDefinition(this.options.query);
|
|
3878
|
+
var vars = queryDef.variableDefinitions;
|
|
3879
|
+
if (!vars || !vars.some(function (v) { return v.variable.name.value === "variables"; })) {
|
|
3880
|
+
__DEV__ && tsInvariant.invariant.warn("Called refetch(" + JSON.stringify(variables) + ") for query " + (((_a = queryDef.name) === null || _a === void 0 ? void 0 : _a.value) || JSON.stringify(queryDef)) + ", which does not declare a $variables variable.\nDid you mean to call refetch(variables) instead of refetch({ variables })?");
|
|
3881
|
+
}
|
|
3882
|
+
}
|
|
3876
3883
|
if (variables && !equality.equal(this.options.variables, variables)) {
|
|
3877
3884
|
reobserveOptions.variables = this.options.variables = tslib.__assign(tslib.__assign({}, this.options.variables), variables);
|
|
3878
3885
|
}
|
|
@@ -4060,7 +4067,7 @@ var ObservableQuery = (function (_super) {
|
|
|
4060
4067
|
var oldVariables = this.options.variables;
|
|
4061
4068
|
var options = useDisposableConcast
|
|
4062
4069
|
? compact(this.options, newOptions)
|
|
4063
|
-
:
|
|
4070
|
+
: assign(this.options, compact(newOptions));
|
|
4064
4071
|
if (!useDisposableConcast) {
|
|
4065
4072
|
this.updatePolling();
|
|
4066
4073
|
if (newOptions &&
|
|
@@ -5726,7 +5733,6 @@ var ApolloClient = (function () {
|
|
|
5726
5733
|
return ApolloClient;
|
|
5727
5734
|
}());
|
|
5728
5735
|
|
|
5729
|
-
checkDEV();
|
|
5730
5736
|
tsInvariant.setVerbosity(DEV ? "log" : "silent");
|
|
5731
5737
|
|
|
5732
5738
|
exports.setLogVerbosity = tsInvariant.setVerbosity;
|