@apollo/client 3.5.0-beta.12 → 3.5.0-beta.16
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 +160 -120
- package/apollo-client.cjs.map +1 -1
- package/apollo-client.min.cjs +1 -0
- package/cache/cache.cjs +86 -65
- package/cache/cache.cjs.map +1 -1
- package/cache/core/cache.d.ts +4 -4
- package/cache/core/cache.d.ts.map +1 -1
- package/cache/core/cache.js +24 -13
- package/cache/core/cache.js.map +1 -1
- package/cache/core/types/Cache.d.ts +10 -10
- package/cache/core/types/Cache.d.ts.map +1 -1
- package/cache/core/types/Cache.js.map +1 -1
- package/cache/core/types/common.d.ts +8 -5
- package/cache/core/types/common.d.ts.map +1 -1
- package/cache/core/types/common.js +6 -11
- package/cache/core/types/common.js.map +1 -1
- package/cache/inmemory/entityStore.js.map +1 -1
- package/cache/inmemory/inMemoryCache.d.ts +4 -4
- package/cache/inmemory/inMemoryCache.d.ts.map +1 -1
- package/cache/inmemory/inMemoryCache.js +3 -1
- package/cache/inmemory/inMemoryCache.js.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 +54 -42
- package/cache/inmemory/readFromStore.js.map +1 -1
- package/cache/inmemory/writeToStore.js +1 -1
- package/core/ApolloClient.js +2 -2
- package/core/ApolloClient.js.map +1 -1
- package/core/LocalState.js +1 -1
- package/core/ObservableQuery.d.ts +2 -1
- package/core/ObservableQuery.d.ts.map +1 -1
- package/core/ObservableQuery.js +3 -3
- package/core/ObservableQuery.js.map +1 -1
- package/core/QueryInfo.d.ts.map +1 -1
- package/core/QueryInfo.js.map +1 -1
- package/core/QueryManager.js +8 -8
- package/core/core.cjs +15 -15
- package/core/core.cjs.map +1 -1
- package/core/watchQueryOptions.js.map +1 -1
- package/invariantErrorCodes.js +52 -65
- package/link/core/ApolloLink.js +1 -1
- package/link/core/core.cjs +1 -1
- package/link/core/core.cjs.map +1 -1
- package/link/http/checkFetcher.js +1 -1
- package/link/http/http.cjs +2 -2
- package/link/http/http.cjs.map +1 -1
- 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/utils/utils.cjs +1 -1
- package/link/utils/utils.cjs.map +1 -1
- package/link/utils/validateOperation.js +1 -1
- package/package.json +8 -8
- package/react/context/ApolloConsumer.js +1 -1
- package/react/context/ApolloContext.d.ts.map +1 -1
- package/react/context/ApolloContext.js +11 -5
- package/react/context/ApolloContext.js.map +1 -1
- package/react/context/ApolloProvider.js +1 -1
- package/react/context/context.cjs +12 -6
- package/react/context/context.cjs.map +1 -1
- package/react/hoc/hoc-utils.js +1 -1
- package/react/hoc/hoc.cjs +10 -7
- package/react/hoc/hoc.cjs.map +1 -1
- package/react/hoc/subscription-hoc.d.ts.map +1 -1
- package/react/hoc/subscription-hoc.js +8 -5
- package/react/hoc/subscription-hoc.js.map +1 -1
- package/react/hoc/withApollo.js +1 -1
- package/react/hooks/hooks.cjs +1 -1
- package/react/hooks/hooks.cjs.map +1 -1
- package/react/hooks/useApolloClient.js +1 -1
- package/react/hooks/useQuery.d.ts +1 -1
- package/react/hooks/useQuery.d.ts.map +1 -1
- package/react/hooks/useQuery.js.map +1 -1
- package/react/parser/index.js +5 -5
- package/react/parser/index.js.map +1 -1
- package/react/parser/parser.cjs +5 -5
- package/react/parser/parser.cjs.map +1 -1
- package/testing/core/core.cjs +288 -0
- package/testing/core/core.cjs.map +1 -0
- package/{utilities/testing → testing/core}/index.d.ts +0 -1
- package/testing/core/index.d.ts.map +1 -0
- package/{utilities/testing → testing/core}/index.js +0 -1
- package/testing/core/index.js.map +1 -0
- package/{utilities/testing → testing/core}/itAsync.d.ts +0 -0
- package/testing/core/itAsync.d.ts.map +1 -0
- package/{utilities/testing → testing/core}/itAsync.js +0 -0
- package/testing/core/itAsync.js.map +1 -0
- package/{utilities/testing → testing/core}/mocking/mockClient.d.ts +0 -0
- package/testing/core/mocking/mockClient.d.ts.map +1 -0
- package/{utilities/testing → testing/core}/mocking/mockClient.js +0 -0
- package/testing/core/mocking/mockClient.js.map +1 -0
- package/{utilities/testing → testing/core}/mocking/mockFetch.d.ts +0 -0
- package/testing/core/mocking/mockFetch.d.ts.map +1 -0
- package/{utilities/testing → testing/core}/mocking/mockFetch.js +0 -0
- package/testing/core/mocking/mockFetch.js.map +1 -0
- package/{utilities/testing → testing/core}/mocking/mockLink.d.ts +0 -0
- package/testing/core/mocking/mockLink.d.ts.map +1 -0
- package/{utilities/testing → testing/core}/mocking/mockLink.js +3 -3
- package/testing/core/mocking/mockLink.js.map +1 -0
- package/{utilities/testing → testing/core}/mocking/mockQueryManager.d.ts +1 -1
- package/testing/core/mocking/mockQueryManager.d.ts.map +1 -0
- package/{utilities/testing → testing/core}/mocking/mockQueryManager.js +1 -1
- package/testing/core/mocking/mockQueryManager.js.map +1 -0
- package/{utilities/testing → testing/core}/mocking/mockSubscriptionLink.d.ts +0 -0
- package/testing/core/mocking/mockSubscriptionLink.d.ts.map +1 -0
- package/{utilities/testing → testing/core}/mocking/mockSubscriptionLink.js +1 -1
- package/testing/core/mocking/mockSubscriptionLink.js.map +1 -0
- package/{utilities/testing → testing/core}/mocking/mockWatchQuery.d.ts +1 -1
- package/testing/core/mocking/mockWatchQuery.d.ts.map +1 -0
- package/{utilities/testing → testing/core}/mocking/mockWatchQuery.js +0 -0
- package/testing/core/mocking/mockWatchQuery.js.map +1 -0
- package/{utilities/testing → testing/core}/observableToPromise.d.ts +2 -3
- package/testing/core/observableToPromise.d.ts.map +1 -0
- package/{utilities/testing → testing/core}/observableToPromise.js +0 -0
- package/testing/core/observableToPromise.js.map +1 -0
- package/testing/core/package.json +8 -0
- package/testing/core/subscribeAndCount.d.ts +4 -0
- package/testing/core/subscribeAndCount.d.ts.map +1 -0
- package/{utilities/testing → testing/core}/subscribeAndCount.js +1 -1
- package/testing/core/subscribeAndCount.js.map +1 -0
- package/{utilities/testing → testing/core}/withConsoleSpy.d.ts +0 -0
- package/testing/core/withConsoleSpy.d.ts.map +1 -0
- package/{utilities/testing → testing/core}/withConsoleSpy.js +0 -0
- package/testing/core/withConsoleSpy.js.map +1 -0
- package/{utilities/testing → testing/core}/wrap.d.ts +0 -0
- package/testing/core/wrap.d.ts.map +1 -0
- package/{utilities/testing → testing/core}/wrap.js +0 -0
- package/testing/core/wrap.js.map +1 -0
- package/testing/index.d.ts +2 -1
- package/testing/index.d.ts.map +1 -1
- package/testing/index.js +2 -1
- package/testing/index.js.map +1 -1
- package/{utilities/testing/mocking → testing/react}/MockedProvider.d.ts +5 -5
- package/testing/react/MockedProvider.d.ts.map +1 -0
- package/{utilities/testing/mocking → testing/react}/MockedProvider.js +4 -4
- package/testing/react/MockedProvider.js.map +1 -0
- package/testing/testing.cjs +6 -330
- package/testing/testing.cjs.map +1 -1
- package/utilities/common/canUse.d.ts +1 -0
- package/utilities/common/canUse.d.ts.map +1 -1
- package/utilities/common/canUse.js +2 -0
- package/utilities/common/canUse.js.map +1 -1
- package/utilities/common/maybeDeepFreeze.d.ts.map +1 -1
- package/utilities/common/maybeDeepFreeze.js +14 -3
- package/utilities/common/maybeDeepFreeze.js.map +1 -1
- package/utilities/globals/globals.cjs +1 -1
- package/utilities/globals/globals.cjs.map +1 -1
- package/utilities/globals/index.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.js +1 -1
- package/utilities/observables/subclassing.d.ts.map +1 -1
- package/utilities/observables/subclassing.js +2 -1
- package/utilities/observables/subclassing.js.map +1 -1
- package/utilities/policies/pagination.d.ts +1 -1
- package/utilities/policies/pagination.d.ts.map +1 -1
- package/utilities/policies/pagination.js +7 -2
- package/utilities/policies/pagination.js.map +1 -1
- package/utilities/utilities.cjs +45 -26
- package/utilities/utilities.cjs.map +1 -1
- package/version.js +1 -1
- package/utilities/testing/index.d.ts.map +0 -1
- package/utilities/testing/index.js.map +0 -1
- package/utilities/testing/itAsync.d.ts.map +0 -1
- package/utilities/testing/itAsync.js.map +0 -1
- package/utilities/testing/mocking/MockedProvider.d.ts.map +0 -1
- package/utilities/testing/mocking/MockedProvider.js.map +0 -1
- package/utilities/testing/mocking/mockClient.d.ts.map +0 -1
- package/utilities/testing/mocking/mockClient.js.map +0 -1
- package/utilities/testing/mocking/mockFetch.d.ts.map +0 -1
- package/utilities/testing/mocking/mockFetch.js.map +0 -1
- package/utilities/testing/mocking/mockLink.d.ts.map +0 -1
- package/utilities/testing/mocking/mockLink.js.map +0 -1
- package/utilities/testing/mocking/mockQueryManager.d.ts.map +0 -1
- package/utilities/testing/mocking/mockQueryManager.js.map +0 -1
- package/utilities/testing/mocking/mockSubscriptionLink.d.ts.map +0 -1
- package/utilities/testing/mocking/mockSubscriptionLink.js.map +0 -1
- package/utilities/testing/mocking/mockWatchQuery.d.ts.map +0 -1
- package/utilities/testing/mocking/mockWatchQuery.js.map +0 -1
- package/utilities/testing/observableToPromise.d.ts.map +0 -1
- package/utilities/testing/observableToPromise.js.map +0 -1
- package/utilities/testing/subscribeAndCount.d.ts +0 -5
- package/utilities/testing/subscribeAndCount.d.ts.map +0 -1
- package/utilities/testing/subscribeAndCount.js.map +0 -1
- package/utilities/testing/withConsoleSpy.d.ts.map +0 -1
- package/utilities/testing/withConsoleSpy.js.map +0 -1
- package/utilities/testing/wrap.d.ts.map +0 -1
- package/utilities/testing/wrap.js.map +0 -1
package/core/QueryManager.js
CHANGED
|
@@ -37,7 +37,7 @@ var QueryManager = (function () {
|
|
|
37
37
|
this.queries.forEach(function (_info, queryId) {
|
|
38
38
|
_this.stopQueryNoBroadcast(queryId);
|
|
39
39
|
});
|
|
40
|
-
this.cancelPendingFetches(__DEV__ ? new InvariantError('QueryManager stopped while query was in flight') : new InvariantError(
|
|
40
|
+
this.cancelPendingFetches(__DEV__ ? new InvariantError('QueryManager stopped while query was in flight') : new InvariantError(11));
|
|
41
41
|
};
|
|
42
42
|
QueryManager.prototype.cancelPendingFetches = function (error) {
|
|
43
43
|
this.fetchCancelFns.forEach(function (cancel) { return cancel(error); });
|
|
@@ -50,10 +50,10 @@ var QueryManager = (function () {
|
|
|
50
50
|
return __generator(this, function (_f) {
|
|
51
51
|
switch (_f.label) {
|
|
52
52
|
case 0:
|
|
53
|
-
__DEV__ ? invariant(mutation, 'mutation option is required. You must specify your GraphQL document in the mutation option.') : invariant(mutation,
|
|
53
|
+
__DEV__ ? invariant(mutation, 'mutation option is required. You must specify your GraphQL document in the mutation option.') : invariant(mutation, 12);
|
|
54
54
|
__DEV__ ? invariant(fetchPolicy === 'network-only' ||
|
|
55
55
|
fetchPolicy === 'no-cache', "Mutations support only 'network-only' or 'no-cache' fetchPolicy strings. The default `network-only` behavior automatically writes mutation results to the cache. Passing `no-cache` skips the cache write.") : invariant(fetchPolicy === 'network-only' ||
|
|
56
|
-
fetchPolicy === 'no-cache',
|
|
56
|
+
fetchPolicy === 'no-cache', 13);
|
|
57
57
|
mutationId = this.generateMutationId();
|
|
58
58
|
mutation = this.transform(mutation).document;
|
|
59
59
|
variables = this.getVariables(mutation, variables);
|
|
@@ -338,10 +338,10 @@ var QueryManager = (function () {
|
|
|
338
338
|
var _this = this;
|
|
339
339
|
if (queryId === void 0) { queryId = this.generateQueryId(); }
|
|
340
340
|
__DEV__ ? invariant(options.query, 'query option is required. You must specify your GraphQL document ' +
|
|
341
|
-
'in the query option.') : invariant(options.query,
|
|
342
|
-
__DEV__ ? invariant(options.query.kind === 'Document', 'You must wrap the query string in a "gql" tag.') : invariant(options.query.kind === 'Document',
|
|
343
|
-
__DEV__ ? invariant(!options.returnPartialData, 'returnPartialData option only supported on watchQuery.') : invariant(!options.returnPartialData,
|
|
344
|
-
__DEV__ ? invariant(!options.pollInterval, 'pollInterval option only supported on watchQuery.') : invariant(!options.pollInterval,
|
|
341
|
+
'in the query option.') : invariant(options.query, 14);
|
|
342
|
+
__DEV__ ? invariant(options.query.kind === 'Document', 'You must wrap the query string in a "gql" tag.') : invariant(options.query.kind === 'Document', 15);
|
|
343
|
+
__DEV__ ? invariant(!options.returnPartialData, 'returnPartialData option only supported on watchQuery.') : invariant(!options.returnPartialData, 16);
|
|
344
|
+
__DEV__ ? invariant(!options.pollInterval, 'pollInterval option only supported on watchQuery.') : invariant(!options.pollInterval, 17);
|
|
345
345
|
return this.fetchQuery(queryId, options).finally(function () { return _this.stopQuery(queryId); });
|
|
346
346
|
};
|
|
347
347
|
QueryManager.prototype.generateQueryId = function () {
|
|
@@ -363,7 +363,7 @@ var QueryManager = (function () {
|
|
|
363
363
|
queryInfo.stop();
|
|
364
364
|
};
|
|
365
365
|
QueryManager.prototype.clearStore = function () {
|
|
366
|
-
this.cancelPendingFetches(__DEV__ ? new InvariantError('Store reset while query was in flight (not completed in link chain)') : new InvariantError(
|
|
366
|
+
this.cancelPendingFetches(__DEV__ ? new InvariantError('Store reset while query was in flight (not completed in link chain)') : new InvariantError(18));
|
|
367
367
|
this.queries.forEach(function (queryInfo) {
|
|
368
368
|
if (queryInfo.observableQuery) {
|
|
369
369
|
queryInfo.networkStatus = NetworkStatus.loading;
|
package/core/core.cjs
CHANGED
|
@@ -15,7 +15,7 @@ var utils = require('../link/utils');
|
|
|
15
15
|
var tsInvariant = require('ts-invariant');
|
|
16
16
|
var graphqlTag = require('graphql-tag');
|
|
17
17
|
|
|
18
|
-
var version = '3.5.0-beta.
|
|
18
|
+
var version = '3.5.0-beta.16';
|
|
19
19
|
|
|
20
20
|
exports.NetworkStatus = void 0;
|
|
21
21
|
(function (NetworkStatus) {
|
|
@@ -338,7 +338,7 @@ var ObservableQuery = (function (_super) {
|
|
|
338
338
|
pollingInfo.interval === pollInterval) {
|
|
339
339
|
return;
|
|
340
340
|
}
|
|
341
|
-
__DEV__ ? globals.invariant(pollInterval, 'Attempted to start a polling query without a polling interval.') : globals.invariant(pollInterval,
|
|
341
|
+
__DEV__ ? globals.invariant(pollInterval, 'Attempted to start a polling query without a polling interval.') : globals.invariant(pollInterval, 10);
|
|
342
342
|
var info = pollingInfo || (this.pollingInfo = {});
|
|
343
343
|
info.interval = pollInterval;
|
|
344
344
|
var maybeFetch = function () {
|
|
@@ -453,8 +453,8 @@ function defaultSubscriptionObserverErrorCallback(error) {
|
|
|
453
453
|
__DEV__ && globals.invariant.error('Unhandled error', error.message, error.stack);
|
|
454
454
|
}
|
|
455
455
|
function logMissingFieldErrors(missing) {
|
|
456
|
-
if (__DEV__ &&
|
|
457
|
-
__DEV__ && globals.invariant.debug("Missing cache result fields: " +
|
|
456
|
+
if (__DEV__ && missing) {
|
|
457
|
+
__DEV__ && globals.invariant.debug("Missing cache result fields: " + JSON.stringify(missing), missing);
|
|
458
458
|
}
|
|
459
459
|
}
|
|
460
460
|
function applyNextFetchPolicy(options) {
|
|
@@ -635,7 +635,7 @@ var LocalState = (function () {
|
|
|
635
635
|
}
|
|
636
636
|
else {
|
|
637
637
|
fragment = fragmentMap[selection.name.value];
|
|
638
|
-
__DEV__ ? globals.invariant(fragment, "No fragment named " + selection.name.value) : globals.invariant(fragment,
|
|
638
|
+
__DEV__ ? globals.invariant(fragment, "No fragment named " + selection.name.value) : globals.invariant(fragment, 9);
|
|
639
639
|
}
|
|
640
640
|
if (fragment && fragment.typeCondition) {
|
|
641
641
|
typeCondition = fragment.typeCondition.name.value;
|
|
@@ -1021,7 +1021,7 @@ var QueryManager = (function () {
|
|
|
1021
1021
|
this.queries.forEach(function (_info, queryId) {
|
|
1022
1022
|
_this.stopQueryNoBroadcast(queryId);
|
|
1023
1023
|
});
|
|
1024
|
-
this.cancelPendingFetches(__DEV__ ? new globals.InvariantError('QueryManager stopped while query was in flight') : new globals.InvariantError(
|
|
1024
|
+
this.cancelPendingFetches(__DEV__ ? new globals.InvariantError('QueryManager stopped while query was in flight') : new globals.InvariantError(11));
|
|
1025
1025
|
};
|
|
1026
1026
|
QueryManager.prototype.cancelPendingFetches = function (error) {
|
|
1027
1027
|
this.fetchCancelFns.forEach(function (cancel) { return cancel(error); });
|
|
@@ -1034,10 +1034,10 @@ var QueryManager = (function () {
|
|
|
1034
1034
|
return tslib.__generator(this, function (_f) {
|
|
1035
1035
|
switch (_f.label) {
|
|
1036
1036
|
case 0:
|
|
1037
|
-
__DEV__ ? globals.invariant(mutation, 'mutation option is required. You must specify your GraphQL document in the mutation option.') : globals.invariant(mutation,
|
|
1037
|
+
__DEV__ ? globals.invariant(mutation, 'mutation option is required. You must specify your GraphQL document in the mutation option.') : globals.invariant(mutation, 12);
|
|
1038
1038
|
__DEV__ ? globals.invariant(fetchPolicy === 'network-only' ||
|
|
1039
1039
|
fetchPolicy === 'no-cache', "Mutations support only 'network-only' or 'no-cache' fetchPolicy strings. The default `network-only` behavior automatically writes mutation results to the cache. Passing `no-cache` skips the cache write.") : globals.invariant(fetchPolicy === 'network-only' ||
|
|
1040
|
-
fetchPolicy === 'no-cache',
|
|
1040
|
+
fetchPolicy === 'no-cache', 13);
|
|
1041
1041
|
mutationId = this.generateMutationId();
|
|
1042
1042
|
mutation = this.transform(mutation).document;
|
|
1043
1043
|
variables = this.getVariables(mutation, variables);
|
|
@@ -1322,10 +1322,10 @@ var QueryManager = (function () {
|
|
|
1322
1322
|
var _this = this;
|
|
1323
1323
|
if (queryId === void 0) { queryId = this.generateQueryId(); }
|
|
1324
1324
|
__DEV__ ? globals.invariant(options.query, 'query option is required. You must specify your GraphQL document ' +
|
|
1325
|
-
'in the query option.') : globals.invariant(options.query,
|
|
1326
|
-
__DEV__ ? globals.invariant(options.query.kind === 'Document', 'You must wrap the query string in a "gql" tag.') : globals.invariant(options.query.kind === 'Document',
|
|
1327
|
-
__DEV__ ? globals.invariant(!options.returnPartialData, 'returnPartialData option only supported on watchQuery.') : globals.invariant(!options.returnPartialData,
|
|
1328
|
-
__DEV__ ? globals.invariant(!options.pollInterval, 'pollInterval option only supported on watchQuery.') : globals.invariant(!options.pollInterval,
|
|
1325
|
+
'in the query option.') : globals.invariant(options.query, 14);
|
|
1326
|
+
__DEV__ ? globals.invariant(options.query.kind === 'Document', 'You must wrap the query string in a "gql" tag.') : globals.invariant(options.query.kind === 'Document', 15);
|
|
1327
|
+
__DEV__ ? globals.invariant(!options.returnPartialData, 'returnPartialData option only supported on watchQuery.') : globals.invariant(!options.returnPartialData, 16);
|
|
1328
|
+
__DEV__ ? globals.invariant(!options.pollInterval, 'pollInterval option only supported on watchQuery.') : globals.invariant(!options.pollInterval, 17);
|
|
1329
1329
|
return this.fetchQuery(queryId, options).finally(function () { return _this.stopQuery(queryId); });
|
|
1330
1330
|
};
|
|
1331
1331
|
QueryManager.prototype.generateQueryId = function () {
|
|
@@ -1347,7 +1347,7 @@ var QueryManager = (function () {
|
|
|
1347
1347
|
queryInfo.stop();
|
|
1348
1348
|
};
|
|
1349
1349
|
QueryManager.prototype.clearStore = function () {
|
|
1350
|
-
this.cancelPendingFetches(__DEV__ ? new globals.InvariantError('Store reset while query was in flight (not completed in link chain)') : new globals.InvariantError(
|
|
1350
|
+
this.cancelPendingFetches(__DEV__ ? new globals.InvariantError('Store reset while query was in flight (not completed in link chain)') : new globals.InvariantError(18));
|
|
1351
1351
|
this.queries.forEach(function (queryInfo) {
|
|
1352
1352
|
if (queryInfo.observableQuery) {
|
|
1353
1353
|
queryInfo.networkStatus = exports.NetworkStatus.loading;
|
|
@@ -1840,7 +1840,7 @@ var ApolloClient = (function () {
|
|
|
1840
1840
|
if (!cache) {
|
|
1841
1841
|
throw __DEV__ ? new globals.InvariantError("To initialize Apollo Client, you must specify a 'cache' property " +
|
|
1842
1842
|
"in the options object. \n" +
|
|
1843
|
-
"For more information, please visit: https://go.apollo.dev/c/docs") : new globals.InvariantError(
|
|
1843
|
+
"For more information, please visit: https://go.apollo.dev/c/docs") : new globals.InvariantError(7);
|
|
1844
1844
|
}
|
|
1845
1845
|
this.link = link;
|
|
1846
1846
|
this.cache = cache;
|
|
@@ -1936,7 +1936,7 @@ var ApolloClient = (function () {
|
|
|
1936
1936
|
__DEV__ ? globals.invariant(options.fetchPolicy !== 'cache-and-network', 'The cache-and-network fetchPolicy does not work with client.query, because ' +
|
|
1937
1937
|
'client.query can only return a single result. Please use client.watchQuery ' +
|
|
1938
1938
|
'to receive multiple results from the cache and the network, or consider ' +
|
|
1939
|
-
'using a different fetchPolicy, such as cache-first or network-only.') : globals.invariant(options.fetchPolicy !== 'cache-and-network',
|
|
1939
|
+
'using a different fetchPolicy, such as cache-first or network-only.') : globals.invariant(options.fetchPolicy !== 'cache-and-network', 8);
|
|
1940
1940
|
if (this.disableNetworkFetches && options.fetchPolicy === 'network-only') {
|
|
1941
1941
|
options = tslib.__assign(tslib.__assign({}, options), { fetchPolicy: 'cache-first' });
|
|
1942
1942
|
}
|