@apollo/client 3.1.0-pre.1 → 3.1.0
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 +123 -157
- package/apollo-client.cjs.js.map +1 -1
- package/apollo-client.cjs.min.js +1 -1
- package/cache/cache.cjs.js +11 -2
- package/cache/cache.cjs.js.map +1 -1
- package/cache/core/cache.js +2 -18
- package/cache/core/cache.js.map +1 -1
- package/cache/core/types/Cache.js +2 -4
- package/cache/core/types/Cache.js.map +1 -1
- package/cache/core/types/common.js +1 -2
- package/cache/core/types/common.js.map +1 -1
- package/cache/index.js +8 -8
- package/cache/inmemory/entityStore.js +7 -23
- package/cache/inmemory/entityStore.js.map +1 -1
- package/cache/inmemory/helpers.js +8 -25
- package/cache/inmemory/helpers.js.map +1 -1
- package/cache/inmemory/inMemoryCache.js +12 -27
- package/cache/inmemory/inMemoryCache.js.map +1 -1
- package/cache/inmemory/policies.d.ts +2 -1
- package/cache/inmemory/policies.d.ts.map +1 -1
- package/cache/inmemory/policies.js +19 -26
- package/cache/inmemory/policies.js.map +1 -1
- package/cache/inmemory/reactiveVars.js +5 -8
- package/cache/inmemory/reactiveVars.js.map +1 -1
- package/cache/inmemory/readFromStore.js +9 -24
- package/cache/inmemory/readFromStore.js.map +1 -1
- package/cache/inmemory/writeToStore.js +7 -22
- package/cache/inmemory/writeToStore.js.map +1 -1
- package/core/ApolloClient.d.ts.map +1 -1
- package/core/ApolloClient.js +11 -25
- package/core/ApolloClient.js.map +1 -1
- package/core/LocalState.js +5 -26
- package/core/LocalState.js.map +1 -1
- package/core/MutationStore.js +1 -2
- package/core/MutationStore.js.map +1 -1
- package/core/ObservableQuery.d.ts +6 -10
- package/core/ObservableQuery.d.ts.map +1 -1
- package/core/ObservableQuery.js +49 -121
- package/core/ObservableQuery.js.map +1 -1
- package/core/QueryInfo.d.ts +2 -2
- package/core/QueryInfo.d.ts.map +1 -1
- package/core/QueryInfo.js +31 -38
- package/core/QueryInfo.js.map +1 -1
- package/core/QueryManager.d.ts +3 -5
- package/core/QueryManager.d.ts.map +1 -1
- package/core/QueryManager.js +32 -63
- package/core/QueryManager.js.map +1 -1
- package/core/Reobserver.d.ts.map +1 -1
- package/core/Reobserver.js +5 -11
- package/core/Reobserver.js.map +1 -1
- package/core/core.cjs.js +93 -155
- package/core/core.cjs.js.map +1 -1
- package/core/index.d.ts +1 -1
- package/core/index.d.ts.map +1 -1
- package/core/index.js +13 -53
- package/core/index.js.map +1 -1
- package/core/networkStatus.js +3 -5
- package/core/networkStatus.js.map +1 -1
- package/core/types.d.ts +3 -0
- package/core/types.d.ts.map +1 -1
- package/core/watchQueryOptions.d.ts +1 -0
- package/core/watchQueryOptions.d.ts.map +1 -1
- package/errors/index.js +5 -21
- package/errors/index.js.map +1 -1
- package/index.js +3 -43
- package/index.js.map +1 -1
- package/invariantErrorCodes.js +1 -1
- package/link/batch/batchLink.js +3 -3
- package/link/batch/batching.js +1 -1
- package/link/batch/index.js +1 -1
- package/link/batch-http/batchHttpLink.js +5 -5
- package/link/batch-http/index.js +1 -1
- package/link/context/index.js +2 -2
- package/link/core/ApolloLink.js +4 -26
- package/link/core/ApolloLink.js.map +1 -1
- package/link/core/concat.js +3 -6
- package/link/core/concat.js.map +1 -1
- package/link/core/empty.js +3 -6
- package/link/core/empty.js.map +1 -1
- package/link/core/execute.js +3 -6
- package/link/core/execute.js.map +1 -1
- package/link/core/from.js +3 -6
- package/link/core/from.js.map +1 -1
- package/link/core/index.js +7 -7
- package/link/core/split.js +3 -6
- package/link/core/split.js.map +1 -1
- package/link/error/index.js +2 -2
- package/link/http/HttpLink.js +4 -11
- package/link/http/HttpLink.js.map +1 -1
- package/link/http/checkFetcher.js +2 -5
- package/link/http/checkFetcher.js.map +1 -1
- package/link/http/createHttpLink.js +13 -41
- package/link/http/createHttpLink.js.map +1 -1
- package/link/http/createSignalIfSupported.js +2 -4
- package/link/http/createSignalIfSupported.js.map +1 -1
- package/link/http/index.js +9 -9
- package/link/http/parseAndCheckHttpResponse.js +3 -12
- package/link/http/parseAndCheckHttpResponse.js.map +1 -1
- package/link/http/rewriteURIForGET.js +3 -6
- package/link/http/rewriteURIForGET.js.map +1 -1
- package/link/http/selectHttpOptionsAndBody.js +4 -7
- package/link/http/selectHttpOptionsAndBody.js.map +1 -1
- package/link/http/selectURI.js +2 -4
- package/link/http/selectURI.js.map +1 -1
- package/link/http/serializeFetchParameter.js +2 -5
- package/link/http/serializeFetchParameter.js.map +1 -1
- package/link/retry/index.js +1 -1
- package/link/retry/retryLink.js +4 -4
- package/link/schema/index.js +2 -2
- package/link/utils/createOperation.js +3 -6
- package/link/utils/createOperation.js.map +1 -1
- package/link/utils/fromError.js +3 -20
- package/link/utils/fromError.js.map +1 -1
- package/link/utils/fromPromise.js +3 -20
- package/link/utils/fromPromise.js.map +1 -1
- package/link/utils/index.js +7 -7
- package/link/utils/throwServerError.js +2 -4
- package/link/utils/throwServerError.js.map +1 -1
- package/link/utils/toPromise.js +2 -5
- package/link/utils/toPromise.js.map +1 -1
- package/link/utils/transformOperation.js +3 -20
- package/link/utils/transformOperation.js.map +1 -1
- package/link/utils/validateOperation.js +2 -5
- package/link/utils/validateOperation.js.map +1 -1
- package/link/ws/index.js +1 -1
- package/package.json +3 -2
- package/react/components/Mutation.js +1 -1
- package/react/components/Query.js +1 -1
- package/react/components/Subscription.js +1 -1
- package/react/components/index.js +4 -4
- package/react/context/ApolloConsumer.js +4 -7
- package/react/context/ApolloConsumer.js.map +1 -1
- package/react/context/ApolloContext.js +3 -6
- package/react/context/ApolloContext.js.map +1 -1
- package/react/context/ApolloProvider.js +4 -7
- package/react/context/ApolloProvider.js.map +1 -1
- package/react/context/index.js +3 -3
- package/react/data/MutationData.d.ts.map +1 -1
- package/react/data/MutationData.js +7 -8
- package/react/data/MutationData.js.map +1 -1
- package/react/data/OperationData.js +3 -5
- package/react/data/OperationData.js.map +1 -1
- package/react/data/QueryData.js +9 -10
- package/react/data/QueryData.js.map +1 -1
- package/react/data/SubscriptionData.js +3 -5
- package/react/data/SubscriptionData.js.map +1 -1
- package/react/data/data.cjs.js +2 -1
- package/react/data/data.cjs.js.map +1 -1
- package/react/data/index.js +4 -4
- package/react/hoc/graphql.js +4 -4
- package/react/hoc/index.js +6 -6
- package/react/hoc/mutation-hoc.js +3 -3
- package/react/hoc/query-hoc.js +3 -3
- package/react/hoc/subscription-hoc.js +3 -3
- package/react/hoc/withApollo.js +1 -1
- package/react/hooks/index.js +5 -5
- package/react/hooks/useApolloClient.js +4 -9
- package/react/hooks/useApolloClient.js.map +1 -1
- package/react/hooks/useLazyQuery.js +3 -6
- package/react/hooks/useLazyQuery.js.map +1 -1
- package/react/hooks/useMutation.js +5 -13
- package/react/hooks/useMutation.js.map +1 -1
- package/react/hooks/useQuery.js +3 -6
- package/react/hooks/useQuery.js.map +1 -1
- package/react/hooks/useSubscription.js +5 -13
- package/react/hooks/useSubscription.js.map +1 -1
- package/react/hooks/utils/useBaseQuery.js +7 -15
- package/react/hooks/utils/useBaseQuery.js.map +1 -1
- package/react/hooks/utils/useDeepMemo.js +3 -6
- package/react/hooks/utils/useDeepMemo.js.map +1 -1
- package/react/index.js +4 -4
- package/react/parser/index.js +4 -7
- package/react/parser/index.js.map +1 -1
- package/react/ssr/getDataFromTree.js +2 -2
- package/react/ssr/index.js +3 -3
- package/react/ssr/renderToStringWithData.js +1 -1
- package/react/types/types.d.ts +1 -0
- package/react/types/types.d.ts.map +1 -1
- package/testing/index.js +1 -1
- package/testing/testing.cjs.js +6 -6
- package/testing/testing.cjs.js.map +1 -1
- package/utilities/common/arrays.js +2 -4
- package/utilities/common/arrays.js.map +1 -1
- package/utilities/common/canUse.js +2 -4
- package/utilities/common/canUse.js.map +1 -1
- package/utilities/common/cloneDeep.js +2 -4
- package/utilities/common/cloneDeep.js.map +1 -1
- package/utilities/common/compact.d.ts +3 -0
- package/utilities/common/compact.d.ts.map +1 -0
- package/utilities/common/compact.js +19 -0
- package/utilities/common/compact.js.map +1 -0
- package/utilities/common/environment.js +5 -7
- package/utilities/common/environment.js.map +1 -1
- package/utilities/common/errorHandling.js +2 -4
- package/utilities/common/errorHandling.js.map +1 -1
- package/utilities/common/filterInPlace.js +2 -4
- package/utilities/common/filterInPlace.js.map +1 -1
- package/utilities/common/maybeDeepFreeze.js +3 -6
- package/utilities/common/maybeDeepFreeze.js.map +1 -1
- package/utilities/common/mergeDeep.js +5 -7
- package/utilities/common/mergeDeep.js.map +1 -1
- package/utilities/graphql/directives.js +7 -10
- package/utilities/graphql/directives.js.map +1 -1
- package/utilities/graphql/fragments.js +6 -9
- package/utilities/graphql/fragments.js.map +1 -1
- package/utilities/graphql/getFromAST.js +10 -13
- package/utilities/graphql/getFromAST.js.map +1 -1
- package/utilities/graphql/storeUtils.js +13 -16
- package/utilities/graphql/storeUtils.js.map +1 -1
- package/utilities/graphql/transform.js +34 -17
- package/utilities/graphql/transform.js.map +1 -1
- package/utilities/index.d.ts +1 -0
- package/utilities/index.d.ts.map +1 -1
- package/utilities/index.js +17 -16
- package/utilities/index.js.map +1 -1
- package/utilities/observables/Concast.js +5 -8
- package/utilities/observables/Concast.js.map +1 -1
- package/utilities/observables/asyncMap.js +3 -7
- package/utilities/observables/asyncMap.js.map +1 -1
- package/utilities/observables/iteration.js +2 -4
- package/utilities/observables/iteration.js.map +1 -1
- package/utilities/testing/index.js +7 -7
- package/utilities/testing/itAsync.d.ts.map +1 -1
- package/utilities/testing/itAsync.js +6 -6
- package/utilities/testing/itAsync.js.map +1 -1
- package/utilities/testing/mocking/MockedProvider.js +4 -4
- package/utilities/testing/mocking/mockClient.js +3 -3
- package/utilities/testing/mocking/mockLink.js +2 -2
- package/utilities/testing/mocking/mockQueryManager.js +3 -3
- package/utilities/testing/mocking/mockSubscriptionLink.js +2 -2
- package/utilities/testing/mocking/mockWatchQuery.js +1 -1
- package/utilities/testing/subscribeAndCount.js +1 -1
- package/utilities/utilities.cjs.js +20 -0
- package/utilities/utilities.cjs.js.map +1 -1
- package/version.js +2 -4
- package/version.js.map +1 -1
package/core/Reobserver.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { NetworkStatus } from "./networkStatus.js";
|
|
2
|
+
import { compact } from "../utilities/index.js";
|
|
1
3
|
import { invariant } from 'ts-invariant';
|
|
2
|
-
import { NetworkStatus } from './networkStatus.js';
|
|
3
|
-
|
|
4
4
|
var Reobserver = (function () {
|
|
5
5
|
function Reobserver(observer, options, fetch, shouldFetch) {
|
|
6
6
|
this.observer = observer;
|
|
@@ -23,13 +23,7 @@ var Reobserver = (function () {
|
|
|
23
23
|
return (this.concast = concast).promise;
|
|
24
24
|
};
|
|
25
25
|
Reobserver.prototype.updateOptions = function (newOptions) {
|
|
26
|
-
|
|
27
|
-
Object.keys(newOptions).forEach(function (key) {
|
|
28
|
-
var value = newOptions[key];
|
|
29
|
-
if (value !== void 0) {
|
|
30
|
-
_this.options[key] = value;
|
|
31
|
-
}
|
|
32
|
-
});
|
|
26
|
+
Object.assign(this.options, compact(newOptions));
|
|
33
27
|
this.updatePolling();
|
|
34
28
|
return this;
|
|
35
29
|
};
|
|
@@ -75,6 +69,7 @@ var Reobserver = (function () {
|
|
|
75
69
|
poll();
|
|
76
70
|
}
|
|
77
71
|
}
|
|
72
|
+
;
|
|
78
73
|
};
|
|
79
74
|
var poll = function () {
|
|
80
75
|
var info = _this.pollingInfo;
|
|
@@ -87,6 +82,5 @@ var Reobserver = (function () {
|
|
|
87
82
|
};
|
|
88
83
|
return Reobserver;
|
|
89
84
|
}());
|
|
90
|
-
|
|
91
85
|
export { Reobserver };
|
|
92
|
-
//# sourceMappingURL=Reobserver.js.map
|
|
86
|
+
//# sourceMappingURL=Reobserver.js.map
|
package/core/Reobserver.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Reobserver.js","
|
|
1
|
+
{"version":3,"file":"Reobserver.js","sourceRoot":"","sources":["../../src/core/Reobserver.ts"],"names":[],"mappings":"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"}
|
package/core/core.cjs.js
CHANGED
|
@@ -7,9 +7,9 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'defau
|
|
|
7
7
|
var tslib = require('tslib');
|
|
8
8
|
var tsInvariant = require('ts-invariant');
|
|
9
9
|
var core = require('../link/core');
|
|
10
|
+
var utilities = require('../utilities');
|
|
10
11
|
var http = require('../link/http');
|
|
11
12
|
var equality = require('@wry/equality');
|
|
12
|
-
var utilities = require('../utilities');
|
|
13
13
|
var errors = require('../errors');
|
|
14
14
|
var visitor = require('graphql/language/visitor');
|
|
15
15
|
var cache = require('../cache');
|
|
@@ -91,13 +91,7 @@ var Reobserver = (function () {
|
|
|
91
91
|
return (this.concast = concast).promise;
|
|
92
92
|
};
|
|
93
93
|
Reobserver.prototype.updateOptions = function (newOptions) {
|
|
94
|
-
|
|
95
|
-
Object.keys(newOptions).forEach(function (key) {
|
|
96
|
-
var value = newOptions[key];
|
|
97
|
-
if (value !== void 0) {
|
|
98
|
-
_this.options[key] = value;
|
|
99
|
-
}
|
|
100
|
-
});
|
|
94
|
+
Object.assign(this.options, utilities.compact(newOptions));
|
|
101
95
|
this.updatePolling();
|
|
102
96
|
return this;
|
|
103
97
|
};
|
|
@@ -156,16 +150,11 @@ var Reobserver = (function () {
|
|
|
156
150
|
return Reobserver;
|
|
157
151
|
}());
|
|
158
152
|
|
|
159
|
-
var hasError = function (storeValue, policy) {
|
|
160
|
-
if (policy === void 0) { policy = 'none'; }
|
|
161
|
-
return storeValue && (storeValue.networkError ||
|
|
162
|
-
(policy === 'none' && utilities.isNonEmptyArray(storeValue.graphQLErrors)));
|
|
163
|
-
};
|
|
164
153
|
var warnedAboutUpdateQuery = false;
|
|
165
154
|
var ObservableQuery = (function (_super) {
|
|
166
155
|
tslib.__extends(ObservableQuery, _super);
|
|
167
156
|
function ObservableQuery(_a) {
|
|
168
|
-
var queryManager = _a.queryManager, options = _a.options;
|
|
157
|
+
var queryManager = _a.queryManager, queryInfo = _a.queryInfo, options = _a.options;
|
|
169
158
|
var _this = _super.call(this, function (observer) {
|
|
170
159
|
return _this.onSubscribe(observer);
|
|
171
160
|
}) || this;
|
|
@@ -189,6 +178,7 @@ var ObservableQuery = (function (_super) {
|
|
|
189
178
|
var opDef = utilities.getOperationDefinition(options.query);
|
|
190
179
|
_this.queryName = opDef && opDef.name && opDef.name.value;
|
|
191
180
|
_this.queryManager = queryManager;
|
|
181
|
+
_this.queryInfo = queryInfo;
|
|
192
182
|
return _this;
|
|
193
183
|
}
|
|
194
184
|
Object.defineProperty(ObservableQuery.prototype, "variables", {
|
|
@@ -218,54 +208,32 @@ var ObservableQuery = (function (_super) {
|
|
|
218
208
|
});
|
|
219
209
|
};
|
|
220
210
|
ObservableQuery.prototype.getCurrentResult = function () {
|
|
221
|
-
var _a = this, lastResult = _a.lastResult, lastError = _a.lastError
|
|
222
|
-
var
|
|
223
|
-
|
|
224
|
-
var networkStatus = lastError ? exports.NetworkStatus.error :
|
|
225
|
-
lastResult ? lastResult.networkStatus :
|
|
226
|
-
isNetworkFetchPolicy ? exports.NetworkStatus.loading :
|
|
227
|
-
exports.NetworkStatus.ready;
|
|
228
|
-
var result = {
|
|
229
|
-
data: !lastError && lastResult && lastResult.data || void 0,
|
|
230
|
-
error: lastError,
|
|
231
|
-
loading: isNetworkRequestInFlight(networkStatus),
|
|
232
|
-
networkStatus: networkStatus,
|
|
233
|
-
};
|
|
211
|
+
var _a = this, lastResult = _a.lastResult, lastError = _a.lastError;
|
|
212
|
+
var networkStatus = this.queryInfo.networkStatus || exports.NetworkStatus.ready;
|
|
213
|
+
var result = tslib.__assign(tslib.__assign({}, (lastError ? { error: lastError } : lastResult)), { loading: isNetworkRequestInFlight(networkStatus), networkStatus: networkStatus });
|
|
234
214
|
if (this.isTornDown) {
|
|
235
215
|
return result;
|
|
236
216
|
}
|
|
237
|
-
var _b = this.
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
}
|
|
255
|
-
Object.assign(result, {
|
|
256
|
-
loading: isNetworkRequestInFlight(networkStatus_1),
|
|
257
|
-
networkStatus: networkStatus_1,
|
|
258
|
-
});
|
|
259
|
-
if (queryStoreValue.graphQLErrors && this.options.errorPolicy === 'all') {
|
|
260
|
-
result.errors = queryStoreValue.graphQLErrors;
|
|
217
|
+
var _b = this.options.fetchPolicy, fetchPolicy = _b === void 0 ? 'cache-first' : _b;
|
|
218
|
+
if (fetchPolicy === 'no-cache' ||
|
|
219
|
+
fetchPolicy === 'network-only') {
|
|
220
|
+
result.partial = false;
|
|
221
|
+
}
|
|
222
|
+
else if (!result.data ||
|
|
223
|
+
!this.queryManager.transform(this.options.query).hasForcedResolvers) {
|
|
224
|
+
var diff = this.queryInfo.getDiff();
|
|
225
|
+
result.partial = !diff.complete;
|
|
226
|
+
result.data = (diff.complete ||
|
|
227
|
+
this.options.returnPartialData) ? diff.result : void 0;
|
|
228
|
+
if (diff.complete &&
|
|
229
|
+
result.networkStatus === exports.NetworkStatus.loading &&
|
|
230
|
+
(fetchPolicy === 'cache-first' ||
|
|
231
|
+
fetchPolicy === 'cache-only')) {
|
|
232
|
+
result.networkStatus = exports.NetworkStatus.ready;
|
|
233
|
+
result.loading = false;
|
|
261
234
|
}
|
|
262
235
|
}
|
|
263
|
-
|
|
264
|
-
this.resetLastResults();
|
|
265
|
-
}
|
|
266
|
-
else {
|
|
267
|
-
this.updateLastResult(result);
|
|
268
|
-
}
|
|
236
|
+
this.updateLastResult(result);
|
|
269
237
|
return result;
|
|
270
238
|
};
|
|
271
239
|
ObservableQuery.prototype.isDifferentFromLastResult = function (newResult) {
|
|
@@ -284,29 +252,25 @@ var ObservableQuery = (function (_super) {
|
|
|
284
252
|
this.isTornDown = false;
|
|
285
253
|
};
|
|
286
254
|
ObservableQuery.prototype.resetQueryStoreErrors = function () {
|
|
287
|
-
|
|
288
|
-
if (queryStore) {
|
|
289
|
-
queryStore.networkError = undefined;
|
|
290
|
-
queryStore.graphQLErrors = [];
|
|
291
|
-
}
|
|
255
|
+
this.queryManager.resetErrors(this.queryId);
|
|
292
256
|
};
|
|
293
257
|
ObservableQuery.prototype.refetch = function (variables) {
|
|
294
258
|
var fetchPolicy = this.options.fetchPolicy;
|
|
295
259
|
if (fetchPolicy === 'cache-only') {
|
|
296
260
|
return Promise.reject(process.env.NODE_ENV === "production" ? new tsInvariant.InvariantError(12) : new tsInvariant.InvariantError('cache-only fetchPolicy option should not be used together with query refetch.'));
|
|
297
261
|
}
|
|
262
|
+
var reobserveOptions = {
|
|
263
|
+
pollInterval: 0,
|
|
264
|
+
};
|
|
298
265
|
if (fetchPolicy !== 'no-cache' &&
|
|
299
266
|
fetchPolicy !== 'cache-and-network') {
|
|
300
|
-
fetchPolicy = 'network-only';
|
|
267
|
+
reobserveOptions.fetchPolicy = 'network-only';
|
|
268
|
+
reobserveOptions.nextFetchPolicy = fetchPolicy;
|
|
301
269
|
}
|
|
302
270
|
if (variables && !equality.equal(this.options.variables, variables)) {
|
|
303
|
-
this.options.variables = tslib.__assign(tslib.__assign({}, this.options.variables), variables);
|
|
271
|
+
reobserveOptions.variables = this.options.variables = tslib.__assign(tslib.__assign({}, this.options.variables), variables);
|
|
304
272
|
}
|
|
305
|
-
return this.newReobserver(false).reobserve(
|
|
306
|
-
fetchPolicy: fetchPolicy,
|
|
307
|
-
variables: this.options.variables,
|
|
308
|
-
pollInterval: 0,
|
|
309
|
-
}, exports.NetworkStatus.refetch);
|
|
273
|
+
return this.newReobserver(false).reobserve(reobserveOptions, exports.NetworkStatus.refetch);
|
|
310
274
|
};
|
|
311
275
|
ObservableQuery.prototype.fetchMore = function (fetchMoreOptions) {
|
|
312
276
|
var _this = this;
|
|
@@ -314,10 +278,7 @@ var ObservableQuery = (function (_super) {
|
|
|
314
278
|
var qid = this.queryManager.generateQueryId();
|
|
315
279
|
if (combinedOptions.notifyOnNetworkStatusChange) {
|
|
316
280
|
var currentResult = this.getCurrentResult();
|
|
317
|
-
|
|
318
|
-
if (queryInfo) {
|
|
319
|
-
queryInfo.networkStatus = exports.NetworkStatus.fetchMore;
|
|
320
|
-
}
|
|
281
|
+
this.queryInfo.networkStatus = exports.NetworkStatus.fetchMore;
|
|
321
282
|
this.observer.next(tslib.__assign(tslib.__assign({}, currentResult), { loading: true, networkStatus: exports.NetworkStatus.fetchMore }));
|
|
322
283
|
}
|
|
323
284
|
return this.queryManager.fetchQuery(qid, combinedOptions, exports.NetworkStatus.fetchMore).then(function (fetchMoreResult) {
|
|
@@ -408,9 +369,16 @@ var ObservableQuery = (function (_super) {
|
|
|
408
369
|
}, exports.NetworkStatus.setVariables);
|
|
409
370
|
};
|
|
410
371
|
ObservableQuery.prototype.updateQuery = function (mapFn) {
|
|
372
|
+
var _a;
|
|
411
373
|
var queryManager = this.queryManager;
|
|
412
|
-
var
|
|
413
|
-
|
|
374
|
+
var result = queryManager.cache.diff({
|
|
375
|
+
query: this.options.query,
|
|
376
|
+
variables: this.variables,
|
|
377
|
+
previousResult: (_a = this.lastResult) === null || _a === void 0 ? void 0 : _a.data,
|
|
378
|
+
returnPartialData: true,
|
|
379
|
+
optimistic: false,
|
|
380
|
+
}).result;
|
|
381
|
+
var newResult = mapFn(result, {
|
|
414
382
|
variables: this.variables,
|
|
415
383
|
});
|
|
416
384
|
if (newResult) {
|
|
@@ -422,35 +390,6 @@ var ObservableQuery = (function (_super) {
|
|
|
422
390
|
queryManager.broadcastQueries();
|
|
423
391
|
}
|
|
424
392
|
};
|
|
425
|
-
ObservableQuery.prototype.getCurrentQueryResult = function (optimistic) {
|
|
426
|
-
var _a, _b;
|
|
427
|
-
if (optimistic === void 0) { optimistic = true; }
|
|
428
|
-
var fetchPolicy = this.options.fetchPolicy;
|
|
429
|
-
var lastData = (_a = this.lastResult) === null || _a === void 0 ? void 0 : _a.data;
|
|
430
|
-
if (fetchPolicy === 'no-cache' ||
|
|
431
|
-
fetchPolicy === 'network-only') {
|
|
432
|
-
return {
|
|
433
|
-
data: lastData,
|
|
434
|
-
partial: false,
|
|
435
|
-
};
|
|
436
|
-
}
|
|
437
|
-
var _c = this.queryManager.cache.diff({
|
|
438
|
-
query: this.options.query,
|
|
439
|
-
variables: this.variables,
|
|
440
|
-
previousResult: (_b = this.lastResult) === null || _b === void 0 ? void 0 : _b.data,
|
|
441
|
-
returnPartialData: true,
|
|
442
|
-
optimistic: optimistic,
|
|
443
|
-
}), result = _c.result, complete = _c.complete;
|
|
444
|
-
if (lastData &&
|
|
445
|
-
!this.lastError &&
|
|
446
|
-
this.queryManager.transform(this.options.query).hasForcedResolvers) {
|
|
447
|
-
result = lastData;
|
|
448
|
-
}
|
|
449
|
-
return {
|
|
450
|
-
data: (complete || this.options.returnPartialData) ? result : void 0,
|
|
451
|
-
partial: !complete,
|
|
452
|
-
};
|
|
453
|
-
};
|
|
454
393
|
ObservableQuery.prototype.startPolling = function (pollInterval) {
|
|
455
394
|
this.getReobserver().updateOptions({ pollInterval: pollInterval });
|
|
456
395
|
};
|
|
@@ -510,7 +449,7 @@ var ObservableQuery = (function (_super) {
|
|
|
510
449
|
return new Reobserver(this.observer, shareOptions ? this.options : tslib.__assign({}, this.options), function (currentOptions, newNetworkStatus) {
|
|
511
450
|
queryManager.setObservableQuery(_this);
|
|
512
451
|
return queryManager.fetchQueryObservable(queryId, currentOptions, newNetworkStatus);
|
|
513
|
-
}, !queryManager.ssrMode && (function () { return !
|
|
452
|
+
}, !queryManager.ssrMode && (function () { return !isNetworkRequestInFlight(_this.queryInfo.networkStatus); }));
|
|
514
453
|
};
|
|
515
454
|
ObservableQuery.prototype.reobserve = function (newOptions, newNetworkStatus) {
|
|
516
455
|
this.isTornDown = false;
|
|
@@ -815,6 +754,9 @@ var QueryInfo = (function () {
|
|
|
815
754
|
!equality.equal(this.variables, query.variables)) {
|
|
816
755
|
networkStatus = exports.NetworkStatus.setVariables;
|
|
817
756
|
}
|
|
757
|
+
if (!equality.equal(query.variables, this.variables)) {
|
|
758
|
+
this.diff = null;
|
|
759
|
+
}
|
|
818
760
|
Object.assign(this, {
|
|
819
761
|
document: query.document,
|
|
820
762
|
variables: query.variables,
|
|
@@ -830,21 +772,28 @@ var QueryInfo = (function () {
|
|
|
830
772
|
}
|
|
831
773
|
return this;
|
|
832
774
|
};
|
|
833
|
-
QueryInfo.prototype.
|
|
834
|
-
|
|
835
|
-
if (
|
|
836
|
-
this.
|
|
837
|
-
if (!this.notifyTimeout) {
|
|
838
|
-
this.notifyTimeout = setTimeout(function () { return _this.notify(); }, 0);
|
|
839
|
-
}
|
|
775
|
+
QueryInfo.prototype.getDiff = function (variables) {
|
|
776
|
+
if (variables === void 0) { variables = this.variables; }
|
|
777
|
+
if (this.diff && equality.equal(variables, this.variables)) {
|
|
778
|
+
return this.diff;
|
|
840
779
|
}
|
|
841
|
-
|
|
780
|
+
this.updateWatch(this.variables = variables);
|
|
781
|
+
return this.diff = this.cache.diff({
|
|
782
|
+
query: this.document,
|
|
783
|
+
variables: variables,
|
|
784
|
+
returnPartialData: true,
|
|
785
|
+
optimistic: true,
|
|
786
|
+
});
|
|
842
787
|
};
|
|
843
788
|
QueryInfo.prototype.setDiff = function (diff) {
|
|
789
|
+
var _this = this;
|
|
844
790
|
var oldDiff = this.diff;
|
|
845
791
|
this.diff = diff;
|
|
846
792
|
if (!this.dirty && (diff === null || diff === void 0 ? void 0 : diff.result) !== (oldDiff === null || oldDiff === void 0 ? void 0 : oldDiff.result)) {
|
|
847
|
-
this.
|
|
793
|
+
this.dirty = true;
|
|
794
|
+
if (!this.notifyTimeout) {
|
|
795
|
+
this.notifyTimeout = setTimeout(function () { return _this.notify(); }, 0);
|
|
796
|
+
}
|
|
848
797
|
}
|
|
849
798
|
};
|
|
850
799
|
QueryInfo.prototype.setObservableQuery = function (oq) {
|
|
@@ -855,6 +804,7 @@ var QueryInfo = (function () {
|
|
|
855
804
|
}
|
|
856
805
|
this.observableQuery = oq;
|
|
857
806
|
if (oq) {
|
|
807
|
+
oq["queryInfo"] = this;
|
|
858
808
|
this.listeners.add(this.oqListener = function () { return oq.reobserve(); });
|
|
859
809
|
}
|
|
860
810
|
else {
|
|
@@ -889,13 +839,6 @@ var QueryInfo = (function () {
|
|
|
889
839
|
QueryInfo.prototype.stop = function () {
|
|
890
840
|
this.cancel();
|
|
891
841
|
delete this.cancel;
|
|
892
|
-
this.variables =
|
|
893
|
-
this.networkStatus =
|
|
894
|
-
this.networkError =
|
|
895
|
-
this.graphQLErrors =
|
|
896
|
-
this.lastWatch =
|
|
897
|
-
this.lastWrittenResult =
|
|
898
|
-
this.lastWrittenVars = void 0;
|
|
899
842
|
var oq = this.observableQuery;
|
|
900
843
|
if (oq)
|
|
901
844
|
oq.stopPolling();
|
|
@@ -903,6 +846,11 @@ var QueryInfo = (function () {
|
|
|
903
846
|
QueryInfo.prototype.cancel = function () { };
|
|
904
847
|
QueryInfo.prototype.updateWatch = function (variables) {
|
|
905
848
|
var _this = this;
|
|
849
|
+
if (variables === void 0) { variables = this.variables; }
|
|
850
|
+
var oq = this.observableQuery;
|
|
851
|
+
if (oq && oq.options.fetchPolicy === "no-cache") {
|
|
852
|
+
return;
|
|
853
|
+
}
|
|
906
854
|
if (!this.lastWatch ||
|
|
907
855
|
this.lastWatch.query !== this.document ||
|
|
908
856
|
!equality.equal(variables, this.lastWatch.variables)) {
|
|
@@ -914,7 +862,6 @@ var QueryInfo = (function () {
|
|
|
914
862
|
callback: function (diff) { return _this.setDiff(diff); },
|
|
915
863
|
});
|
|
916
864
|
}
|
|
917
|
-
return this;
|
|
918
865
|
};
|
|
919
866
|
QueryInfo.prototype.markResult = function (result, options, allowCacheWrite) {
|
|
920
867
|
var _this = this;
|
|
@@ -953,6 +900,7 @@ var QueryInfo = (function () {
|
|
|
953
900
|
returnPartialData: true,
|
|
954
901
|
optimistic: true,
|
|
955
902
|
});
|
|
903
|
+
_this.updateWatch(options.variables);
|
|
956
904
|
_this.diff = diff;
|
|
957
905
|
if (diff.complete) {
|
|
958
906
|
result.data = diff.result;
|
|
@@ -1188,8 +1136,12 @@ var QueryManager = (function () {
|
|
|
1188
1136
|
});
|
|
1189
1137
|
return store;
|
|
1190
1138
|
};
|
|
1191
|
-
QueryManager.prototype.
|
|
1192
|
-
|
|
1139
|
+
QueryManager.prototype.resetErrors = function (queryId) {
|
|
1140
|
+
var queryInfo = this.queries.get(queryId);
|
|
1141
|
+
if (queryInfo) {
|
|
1142
|
+
queryInfo.networkError = undefined;
|
|
1143
|
+
queryInfo.graphQLErrors = [];
|
|
1144
|
+
}
|
|
1193
1145
|
};
|
|
1194
1146
|
QueryManager.prototype.transform = function (document) {
|
|
1195
1147
|
var transformCache = this.transformCache;
|
|
@@ -1226,11 +1178,14 @@ var QueryManager = (function () {
|
|
|
1226
1178
|
if (typeof options.notifyOnNetworkStatusChange === 'undefined') {
|
|
1227
1179
|
options.notifyOnNetworkStatusChange = false;
|
|
1228
1180
|
}
|
|
1181
|
+
var queryInfo = new QueryInfo(this.cache);
|
|
1229
1182
|
var observable = new ObservableQuery({
|
|
1230
1183
|
queryManager: this,
|
|
1184
|
+
queryInfo: queryInfo,
|
|
1231
1185
|
options: options,
|
|
1232
1186
|
});
|
|
1233
|
-
this.
|
|
1187
|
+
this.queries.set(observable.queryId, queryInfo);
|
|
1188
|
+
queryInfo.init({
|
|
1234
1189
|
document: options.query,
|
|
1235
1190
|
observableQuery: observable,
|
|
1236
1191
|
variables: options.variables,
|
|
@@ -1265,9 +1220,6 @@ var QueryManager = (function () {
|
|
|
1265
1220
|
if (queryInfo)
|
|
1266
1221
|
queryInfo.stop();
|
|
1267
1222
|
};
|
|
1268
|
-
QueryManager.prototype.addQueryListener = function (queryId, listener) {
|
|
1269
|
-
this.getQuery(queryId).listeners.add(listener);
|
|
1270
|
-
};
|
|
1271
1223
|
QueryManager.prototype.clearStore = function () {
|
|
1272
1224
|
this.cancelPendingFetches(process.env.NODE_ENV === "production" ? new tsInvariant.InvariantError(20) : new tsInvariant.InvariantError('Store reset while query was in flight (not completed in link chain)'));
|
|
1273
1225
|
this.queries.forEach(function (queryInfo) {
|
|
@@ -1463,10 +1415,6 @@ var QueryManager = (function () {
|
|
|
1463
1415
|
var queryInfo = this.getQuery(queryId);
|
|
1464
1416
|
var oldNetworkStatus = queryInfo.networkStatus;
|
|
1465
1417
|
var _a = options.fetchPolicy, fetchPolicy = _a === void 0 ? "cache-first" : _a, _b = options.errorPolicy, errorPolicy = _b === void 0 ? "none" : _b, _c = options.returnPartialData, returnPartialData = _c === void 0 ? false : _c, _d = options.notifyOnNetworkStatusChange, notifyOnNetworkStatusChange = _d === void 0 ? false : _d, _e = options.context, context = _e === void 0 ? {} : _e;
|
|
1466
|
-
if (fetchPolicy === "cache-and-network" ||
|
|
1467
|
-
fetchPolicy === "network-only") {
|
|
1468
|
-
options.fetchPolicy = "cache-first";
|
|
1469
|
-
}
|
|
1470
1418
|
var mightUseNetwork = fetchPolicy === "cache-first" ||
|
|
1471
1419
|
fetchPolicy === "cache-and-network" ||
|
|
1472
1420
|
fetchPolicy === "network-only" ||
|
|
@@ -1500,7 +1448,13 @@ var QueryManager = (function () {
|
|
|
1500
1448
|
var concast = new utilities.Concast(this.transform(normalized.query).hasClientExports
|
|
1501
1449
|
? this.localState.addExportedVariables(normalized.query, normalized.variables, normalized.context).then(fromVariables)
|
|
1502
1450
|
: fromVariables(normalized.variables));
|
|
1503
|
-
concast.cleanup(function () {
|
|
1451
|
+
concast.cleanup(function () {
|
|
1452
|
+
_this.fetchCancelFns.delete(queryId);
|
|
1453
|
+
if (options.nextFetchPolicy) {
|
|
1454
|
+
options.fetchPolicy = options.nextFetchPolicy;
|
|
1455
|
+
options.nextFetchPolicy = void 0;
|
|
1456
|
+
}
|
|
1457
|
+
});
|
|
1504
1458
|
return concast;
|
|
1505
1459
|
};
|
|
1506
1460
|
QueryManager.prototype.fetchQueryByPolicy = function (queryInfo, options, networkStatus) {
|
|
@@ -1511,13 +1465,8 @@ var QueryManager = (function () {
|
|
|
1511
1465
|
variables: variables,
|
|
1512
1466
|
lastRequestId: this.generateRequestId(),
|
|
1513
1467
|
networkStatus: networkStatus,
|
|
1514
|
-
})
|
|
1515
|
-
var readCache = function () { return
|
|
1516
|
-
query: query,
|
|
1517
|
-
variables: variables,
|
|
1518
|
-
returnPartialData: true,
|
|
1519
|
-
optimistic: true,
|
|
1520
|
-
}); };
|
|
1468
|
+
});
|
|
1469
|
+
var readCache = function () { return queryInfo.getDiff(variables); };
|
|
1521
1470
|
var resultsFromCache = function (diff, networkStatus) {
|
|
1522
1471
|
if (networkStatus === void 0) { networkStatus = queryInfo.networkStatus || exports.NetworkStatus.loading; }
|
|
1523
1472
|
var data = diff.result;
|
|
@@ -1526,11 +1475,7 @@ var QueryManager = (function () {
|
|
|
1526
1475
|
!equality.equal(data, {})) {
|
|
1527
1476
|
process.env.NODE_ENV === "production" || tsInvariant.invariant.warn("Missing cache result fields: " + diff.missing.map(function (m) { return m.path.join('.'); }).join(', '), diff.missing);
|
|
1528
1477
|
}
|
|
1529
|
-
var fromData = function (data) { return utilities.Observable.of({
|
|
1530
|
-
data: data,
|
|
1531
|
-
loading: isNetworkRequestInFlight(networkStatus),
|
|
1532
|
-
networkStatus: networkStatus,
|
|
1533
|
-
}); };
|
|
1478
|
+
var fromData = function (data) { return utilities.Observable.of(tslib.__assign({ data: data, loading: isNetworkRequestInFlight(networkStatus), networkStatus: networkStatus }, (diff.complete ? null : { partial: true }))); };
|
|
1534
1479
|
if (_this.transform(query).hasForcedResolvers) {
|
|
1535
1480
|
return _this.localState.runResolvers({
|
|
1536
1481
|
document: query,
|
|
@@ -1604,13 +1549,6 @@ var QueryManager = (function () {
|
|
|
1604
1549
|
var newContext = this.localState.prepareContext(context);
|
|
1605
1550
|
return tslib.__assign(tslib.__assign({}, newContext), { clientAwareness: this.clientAwareness });
|
|
1606
1551
|
};
|
|
1607
|
-
QueryManager.prototype.checkInFlight = function (queryId) {
|
|
1608
|
-
var query = this.getQueryStoreValue(queryId);
|
|
1609
|
-
return (!!query &&
|
|
1610
|
-
!!query.networkStatus &&
|
|
1611
|
-
query.networkStatus !== exports.NetworkStatus.ready &&
|
|
1612
|
-
query.networkStatus !== exports.NetworkStatus.error);
|
|
1613
|
-
};
|
|
1614
1552
|
return QueryManager;
|
|
1615
1553
|
}());
|
|
1616
1554
|
function markMutationResult(mutation, cache) {
|
|
@@ -1752,7 +1690,7 @@ var ApolloClient = (function () {
|
|
|
1752
1690
|
};
|
|
1753
1691
|
ApolloClient.prototype.watchQuery = function (options) {
|
|
1754
1692
|
if (this.defaultOptions.watchQuery) {
|
|
1755
|
-
options =
|
|
1693
|
+
options = utilities.compact(this.defaultOptions.watchQuery, options);
|
|
1756
1694
|
}
|
|
1757
1695
|
if (this.disableNetworkFetches &&
|
|
1758
1696
|
(options.fetchPolicy === 'network-only' ||
|
|
@@ -1763,7 +1701,7 @@ var ApolloClient = (function () {
|
|
|
1763
1701
|
};
|
|
1764
1702
|
ApolloClient.prototype.query = function (options) {
|
|
1765
1703
|
if (this.defaultOptions.query) {
|
|
1766
|
-
options =
|
|
1704
|
+
options = utilities.compact(this.defaultOptions.query, options);
|
|
1767
1705
|
}
|
|
1768
1706
|
process.env.NODE_ENV === "production" ? tsInvariant.invariant(options.fetchPolicy !== 'cache-and-network', 10) : tsInvariant.invariant(options.fetchPolicy !== 'cache-and-network', 'The cache-and-network fetchPolicy does not work with client.query, because ' +
|
|
1769
1707
|
'client.query can only return a single result. Please use client.watchQuery ' +
|
|
@@ -1776,7 +1714,7 @@ var ApolloClient = (function () {
|
|
|
1776
1714
|
};
|
|
1777
1715
|
ApolloClient.prototype.mutate = function (options) {
|
|
1778
1716
|
if (this.defaultOptions.mutate) {
|
|
1779
|
-
options =
|
|
1717
|
+
options = utilities.compact(this.defaultOptions.mutate, options);
|
|
1780
1718
|
}
|
|
1781
1719
|
return this.queryManager.mutate(options);
|
|
1782
1720
|
};
|