@apollo/client 3.8.5 → 3.8.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/apollo-client.cjs +114 -74
- package/apollo-client.cjs.map +1 -1
- package/apollo-client.min.cjs +1 -1
- package/cache/cache.cjs +46 -11
- package/cache/cache.cjs.map +1 -1
- package/cache/cache.cjs.native.js +46 -11
- package/cache/core/types/common.d.ts +2 -2
- package/cache/core/types/common.d.ts.map +1 -1
- package/cache/core/types/common.js.map +1 -1
- package/cache/inmemory/entityStore.d.ts.map +1 -1
- package/cache/inmemory/entityStore.js +35 -0
- package/cache/inmemory/entityStore.js.map +1 -1
- package/cache/inmemory/key-extractor.js +1 -1
- package/cache/inmemory/policies.js +4 -4
- package/cache/inmemory/readFromStore.js +2 -2
- package/cache/inmemory/writeToStore.js +4 -4
- package/core/ApolloClient.js +3 -3
- package/core/LocalState.js +2 -2
- package/core/ObservableQuery.js +5 -5
- package/core/QueryManager.js +9 -9
- package/core/core.cjs +20 -20
- package/core/core.cjs.map +1 -1
- package/core/core.cjs.native.js +20 -20
- package/dev/dev.cjs +97 -82
- package/dev/dev.cjs.map +1 -1
- package/dev/dev.cjs.native.js +97 -82
- package/dev/loadErrorMessageHandler.js +1 -1
- package/dev/loadErrorMessageHandler.js.map +1 -1
- package/invariantErrorCodes.js +95 -80
- package/link/core/ApolloLink.js +2 -2
- package/link/core/core.cjs +2 -2
- package/link/core/core.cjs.map +1 -1
- package/link/core/core.cjs.native.js +2 -2
- package/link/http/checkFetcher.js +1 -1
- package/link/http/createHttpLink.js +1 -1
- package/link/http/http.cjs +3 -3
- package/link/http/http.cjs.map +1 -1
- package/link/http/http.cjs.native.js +3 -3
- package/link/http/serializeFetchParameter.js +1 -1
- package/link/persisted-queries/index.js +2 -2
- package/link/persisted-queries/persisted-queries.cjs +2 -2
- package/link/persisted-queries/persisted-queries.cjs.map +1 -1
- package/link/persisted-queries/persisted-queries.cjs.native.js +2 -2
- package/link/utils/toPromise.js +1 -1
- package/link/utils/utils.cjs +2 -2
- package/link/utils/utils.cjs.map +1 -1
- package/link/utils/utils.cjs.native.js +2 -2
- package/link/utils/validateOperation.js +1 -1
- package/package.json +25 -25
- package/react/cache/QueryReference.d.ts.map +1 -1
- package/react/cache/QueryReference.js +7 -2
- package/react/cache/QueryReference.js.map +1 -1
- package/react/context/ApolloConsumer.js +1 -1
- package/react/context/ApolloContext.js +1 -1
- package/react/context/ApolloProvider.js +1 -1
- package/react/context/context.cjs +3 -3
- package/react/context/context.cjs.map +1 -1
- package/react/context/context.cjs.native.js +3 -3
- package/react/hoc/hoc-utils.js +1 -1
- package/react/hoc/hoc.cjs +2 -2
- package/react/hoc/hoc.cjs.map +1 -1
- package/react/hoc/hoc.cjs.native.js +2 -2
- package/react/hoc/withApollo.js +1 -1
- package/react/hooks/hooks.cjs +15 -10
- package/react/hooks/hooks.cjs.map +1 -1
- package/react/hooks/hooks.cjs.native.js +15 -10
- package/react/hooks/index.d.ts +1 -0
- package/react/hooks/index.d.ts.map +1 -1
- package/react/hooks/index.js.map +1 -1
- package/react/hooks/useApolloClient.js +1 -1
- package/react/hooks/useQuery.js +1 -1
- package/react/hooks/useReadQuery.d.ts +7 -4
- package/react/hooks/useReadQuery.d.ts.map +1 -1
- package/react/hooks/useReadQuery.js +1 -1
- package/react/hooks/useReadQuery.js.map +1 -1
- package/react/hooks/useSubscription.js +2 -2
- package/react/hooks/useSuspenseQuery.js +2 -2
- package/react/hooks/useSyncExternalStore.js +1 -1
- package/react/parser/index.js +5 -5
- package/react/parser/parser.cjs +5 -5
- package/react/parser/parser.cjs.map +1 -1
- package/react/parser/parser.cjs.native.js +5 -5
- package/testing/core/core.cjs +1 -1
- package/testing/core/core.cjs.map +1 -1
- package/testing/core/core.cjs.native.js +1 -1
- package/testing/core/mocking/mockLink.js +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 -1
- package/testing/react/MockedProvider.js.map +1 -1
- package/testing/testing.cjs +2 -1
- package/testing/testing.cjs.map +1 -1
- package/testing/testing.cjs.native.js +2 -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 +4 -4
- package/utilities/graphql/fragments.js +3 -3
- package/utilities/graphql/getFromAST.js +8 -8
- package/utilities/graphql/storeUtils.d.ts +5 -0
- 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.js +2 -2
- package/utilities/index.d.ts +1 -1
- package/utilities/index.d.ts.map +1 -1
- package/utilities/index.js.map +1 -1
- package/utilities/utilities.cjs +19 -19
- package/utilities/utilities.cjs.map +1 -1
- package/utilities/utilities.cjs.native.js +19 -19
- package/version.js +1 -1
package/core/core.cjs.native.js
CHANGED
|
@@ -19,7 +19,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
19
19
|
|
|
20
20
|
var equal__default = /*#__PURE__*/_interopDefaultLegacy(equal);
|
|
21
21
|
|
|
22
|
-
var version = "3.8.
|
|
22
|
+
var version = "3.8.7";
|
|
23
23
|
|
|
24
24
|
function isNonNullObject(obj) {
|
|
25
25
|
return obj !== null && typeof obj === "object";
|
|
@@ -369,7 +369,7 @@ var ObservableQuery = (function (_super) {
|
|
|
369
369
|
var vars = queryDef.variableDefinitions;
|
|
370
370
|
if (!vars || !vars.some(function (v) { return v.variable.name.value === "variables"; })) {
|
|
371
371
|
globalThis.__DEV__ !== false && globals.invariant.warn(
|
|
372
|
-
|
|
372
|
+
20,
|
|
373
373
|
variables,
|
|
374
374
|
((_a = queryDef.name) === null || _a === void 0 ? void 0 : _a.value) || queryDef
|
|
375
375
|
);
|
|
@@ -467,7 +467,7 @@ var ObservableQuery = (function (_super) {
|
|
|
467
467
|
options.onError(err);
|
|
468
468
|
return;
|
|
469
469
|
}
|
|
470
|
-
globalThis.__DEV__ !== false && globals.invariant.error(
|
|
470
|
+
globalThis.__DEV__ !== false && globals.invariant.error(21, err);
|
|
471
471
|
},
|
|
472
472
|
});
|
|
473
473
|
this.subscriptions.add(subscription);
|
|
@@ -566,7 +566,7 @@ var ObservableQuery = (function (_super) {
|
|
|
566
566
|
if (pollingInfo && pollingInfo.interval === pollInterval) {
|
|
567
567
|
return;
|
|
568
568
|
}
|
|
569
|
-
globals.invariant(pollInterval,
|
|
569
|
+
globals.invariant(pollInterval, 22);
|
|
570
570
|
var info = pollingInfo || (this.pollingInfo = {});
|
|
571
571
|
info.interval = pollInterval;
|
|
572
572
|
var maybeFetch = function () {
|
|
@@ -731,11 +731,11 @@ function reobserveCacheFirst(obsQuery) {
|
|
|
731
731
|
return obsQuery.reobserve();
|
|
732
732
|
}
|
|
733
733
|
function defaultSubscriptionObserverErrorCallback(error) {
|
|
734
|
-
globalThis.__DEV__ !== false && globals.invariant.error(
|
|
734
|
+
globalThis.__DEV__ !== false && globals.invariant.error(23, error.message, error.stack);
|
|
735
735
|
}
|
|
736
736
|
function logMissingFieldErrors(missing) {
|
|
737
737
|
if (globalThis.__DEV__ !== false && missing) {
|
|
738
|
-
globalThis.__DEV__ !== false && globals.invariant.debug(
|
|
738
|
+
globalThis.__DEV__ !== false && globals.invariant.debug(24, missing);
|
|
739
739
|
}
|
|
740
740
|
}
|
|
741
741
|
function skipCacheDataFor(fetchPolicy) {
|
|
@@ -920,7 +920,7 @@ var LocalState = (function () {
|
|
|
920
920
|
}
|
|
921
921
|
else {
|
|
922
922
|
fragment = fragmentMap[selection.name.value];
|
|
923
|
-
globals.invariant(fragment,
|
|
923
|
+
globals.invariant(fragment, 18, selection.name.value);
|
|
924
924
|
}
|
|
925
925
|
if (fragment && fragment.typeCondition) {
|
|
926
926
|
typeCondition = fragment.typeCondition.name.value;
|
|
@@ -1033,7 +1033,7 @@ var LocalState = (function () {
|
|
|
1033
1033
|
},
|
|
1034
1034
|
FragmentSpread: function (spread, _, __, ___, ancestors) {
|
|
1035
1035
|
var fragment = fragmentMap[spread.name.value];
|
|
1036
|
-
globals.invariant(fragment,
|
|
1036
|
+
globals.invariant(fragment, 19, spread.name.value);
|
|
1037
1037
|
var fragmentSelections = collectByDefinition(fragment);
|
|
1038
1038
|
if (fragmentSelections.size > 0) {
|
|
1039
1039
|
ancestors.forEach(function (node) {
|
|
@@ -1363,7 +1363,7 @@ var QueryManager = (function () {
|
|
|
1363
1363
|
this.queries.forEach(function (_info, queryId) {
|
|
1364
1364
|
_this.stopQueryNoBroadcast(queryId);
|
|
1365
1365
|
});
|
|
1366
|
-
this.cancelPendingFetches(globals.newInvariantError(
|
|
1366
|
+
this.cancelPendingFetches(globals.newInvariantError(25));
|
|
1367
1367
|
};
|
|
1368
1368
|
QueryManager.prototype.cancelPendingFetches = function (error) {
|
|
1369
1369
|
this.fetchCancelFns.forEach(function (cancel) { return cancel(error); });
|
|
@@ -1377,8 +1377,8 @@ var QueryManager = (function () {
|
|
|
1377
1377
|
return tslib.__generator(this, function (_h) {
|
|
1378
1378
|
switch (_h.label) {
|
|
1379
1379
|
case 0:
|
|
1380
|
-
globals.invariant(mutation,
|
|
1381
|
-
globals.invariant(fetchPolicy === "network-only" || fetchPolicy === "no-cache",
|
|
1380
|
+
globals.invariant(mutation, 26);
|
|
1381
|
+
globals.invariant(fetchPolicy === "network-only" || fetchPolicy === "no-cache", 27);
|
|
1382
1382
|
mutationId = this.generateMutationId();
|
|
1383
1383
|
mutation = this.cache.transformForLink(this.transform(mutation));
|
|
1384
1384
|
hasClientExports = this.getDocumentInfo(mutation).hasClientExports;
|
|
@@ -1699,10 +1699,10 @@ var QueryManager = (function () {
|
|
|
1699
1699
|
QueryManager.prototype.query = function (options, queryId) {
|
|
1700
1700
|
var _this = this;
|
|
1701
1701
|
if (queryId === void 0) { queryId = this.generateQueryId(); }
|
|
1702
|
-
globals.invariant(options.query,
|
|
1703
|
-
globals.invariant(options.query.kind === "Document",
|
|
1704
|
-
globals.invariant(!options.returnPartialData,
|
|
1705
|
-
globals.invariant(!options.pollInterval,
|
|
1702
|
+
globals.invariant(options.query, 28);
|
|
1703
|
+
globals.invariant(options.query.kind === "Document", 29);
|
|
1704
|
+
globals.invariant(!options.returnPartialData, 30);
|
|
1705
|
+
globals.invariant(!options.pollInterval, 31);
|
|
1706
1706
|
return this.fetchQuery(queryId, tslib.__assign(tslib.__assign({}, options), { query: this.transform(options.query) })).finally(function () { return _this.stopQuery(queryId); });
|
|
1707
1707
|
};
|
|
1708
1708
|
QueryManager.prototype.generateQueryId = function () {
|
|
@@ -1727,7 +1727,7 @@ var QueryManager = (function () {
|
|
|
1727
1727
|
if (options === void 0) { options = {
|
|
1728
1728
|
discardWatches: true,
|
|
1729
1729
|
}; }
|
|
1730
|
-
this.cancelPendingFetches(globals.newInvariantError(
|
|
1730
|
+
this.cancelPendingFetches(globals.newInvariantError(32));
|
|
1731
1731
|
this.queries.forEach(function (queryInfo) {
|
|
1732
1732
|
if (queryInfo.observableQuery) {
|
|
1733
1733
|
queryInfo.networkStatus = exports.NetworkStatus.loading;
|
|
@@ -1803,7 +1803,7 @@ var QueryManager = (function () {
|
|
|
1803
1803
|
if (globalThis.__DEV__ !== false && queryNamesAndDocs.size) {
|
|
1804
1804
|
queryNamesAndDocs.forEach(function (included, nameOrDoc) {
|
|
1805
1805
|
if (!included) {
|
|
1806
|
-
globalThis.__DEV__ !== false && globals.invariant.warn(typeof nameOrDoc === "string" ?
|
|
1806
|
+
globalThis.__DEV__ !== false && globals.invariant.warn(typeof nameOrDoc === "string" ? 33 : 34, nameOrDoc);
|
|
1807
1807
|
}
|
|
1808
1808
|
});
|
|
1809
1809
|
}
|
|
@@ -2240,7 +2240,7 @@ var ApolloClient = (function () {
|
|
|
2240
2240
|
this.resetStoreCallbacks = [];
|
|
2241
2241
|
this.clearStoreCallbacks = [];
|
|
2242
2242
|
if (!options.cache) {
|
|
2243
|
-
throw globals.newInvariantError(
|
|
2243
|
+
throw globals.newInvariantError(15);
|
|
2244
2244
|
}
|
|
2245
2245
|
var uri = options.uri, credentials = options.credentials, headers = options.headers, cache = options.cache, documentTransform = options.documentTransform, _a = options.ssrMode, ssrMode = _a === void 0 ? false : _a, _b = options.ssrForceFetchDelay, ssrForceFetchDelay = _b === void 0 ? 0 : _b, _c = options.connectToDevTools, connectToDevTools = _c === void 0 ? typeof window === "object" &&
|
|
2246
2246
|
!window.__APOLLO_CLIENT__ &&
|
|
@@ -2365,7 +2365,7 @@ var ApolloClient = (function () {
|
|
|
2365
2365
|
if (this.defaultOptions.query) {
|
|
2366
2366
|
options = utilities.mergeOptions(this.defaultOptions.query, options);
|
|
2367
2367
|
}
|
|
2368
|
-
globals.invariant(options.fetchPolicy !== "cache-and-network",
|
|
2368
|
+
globals.invariant(options.fetchPolicy !== "cache-and-network", 16);
|
|
2369
2369
|
if (this.disableNetworkFetches && options.fetchPolicy === "network-only") {
|
|
2370
2370
|
options = tslib.__assign(tslib.__assign({}, options), { fetchPolicy: "cache-first" });
|
|
2371
2371
|
}
|
|
@@ -2458,7 +2458,7 @@ var ApolloClient = (function () {
|
|
|
2458
2458
|
result.queries = queries;
|
|
2459
2459
|
result.results = results;
|
|
2460
2460
|
result.catch(function (error) {
|
|
2461
|
-
globalThis.__DEV__ !== false && globals.invariant.debug(
|
|
2461
|
+
globalThis.__DEV__ !== false && globals.invariant.debug(17, error);
|
|
2462
2462
|
});
|
|
2463
2463
|
return result;
|
|
2464
2464
|
};
|