@apollo/client 3.6.5 → 3.6.8
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 +4 -5
- package/apollo-client.cjs +17 -6
- package/apollo-client.cjs.map +1 -1
- package/apollo-client.min.cjs +1 -1
- package/cache/cache.cjs +1 -1
- package/cache/cache.cjs.map +1 -1
- package/cache/cache.cjs.native.js +1 -1
- package/cache/inmemory/policies.js +1 -1
- package/cache/inmemory/policies.js.map +1 -1
- package/core/ObservableQuery.js +1 -1
- package/core/ObservableQuery.js.map +1 -1
- package/core/core.cjs +2 -2
- package/core/core.cjs.map +1 -1
- package/core/core.cjs.native.js +2 -2
- package/invariantErrorCodes.js +1 -1
- package/link/batch/batch.cjs +1 -2
- package/link/batch/batch.cjs.map +1 -1
- package/link/batch/batch.cjs.native.js +1 -2
- package/link/batch/batching.d.ts.map +1 -1
- package/link/batch/batching.js +1 -2
- package/link/batch/batching.js.map +1 -1
- package/package.json +6 -5
- package/react/hooks/hooks.cjs +14 -3
- package/react/hooks/hooks.cjs.map +1 -1
- package/react/hooks/hooks.cjs.native.js +14 -3
- package/react/hooks/useQuery.d.ts +1 -0
- package/react/hooks/useQuery.d.ts.map +1 -1
- package/react/hooks/useQuery.js +15 -4
- package/react/hooks/useQuery.js.map +1 -1
- package/version.js +1 -1
package/README.md
CHANGED
|
@@ -19,12 +19,11 @@ The Apollo Client API reference can be found at: <br/>
|
|
|
19
19
|
Learn how to use Apollo Client with self-paced hands-on training on Odyssey, Apollo's official learning platform: <br/>
|
|
20
20
|
[https://odyssey.apollographql.com/](https://odyssey.apollographql.com/)
|
|
21
21
|
|
|
22
|
-
## Maintainers
|
|
22
|
+
## Apollo Maintainers
|
|
23
23
|
|
|
24
|
-
- [@benjamn](https://github.com/benjamn)
|
|
25
|
-
- [@
|
|
26
|
-
- [@
|
|
27
|
-
- [@hwillson](https://github.com/hwillson) (Apollo)
|
|
24
|
+
- [@benjamn](https://github.com/benjamn)
|
|
25
|
+
- [@hwillson](https://github.com/hwillson)
|
|
26
|
+
- [@jpvajda](https://github.com/jpvajda)
|
|
28
27
|
|
|
29
28
|
## Who is Apollo?
|
|
30
29
|
|
package/apollo-client.cjs
CHANGED
|
@@ -1300,7 +1300,7 @@ var concat = ApolloLink.concat;
|
|
|
1300
1300
|
|
|
1301
1301
|
var execute = ApolloLink.execute;
|
|
1302
1302
|
|
|
1303
|
-
var version = '3.6.
|
|
1303
|
+
var version = '3.6.8';
|
|
1304
1304
|
|
|
1305
1305
|
var hasOwnProperty$3 = Object.prototype.hasOwnProperty;
|
|
1306
1306
|
function parseAndCheckHttpResponse(operations) {
|
|
@@ -3119,7 +3119,7 @@ function makeFieldFunctionOptions(policies, objectOrReference, fieldSpec, contex
|
|
|
3119
3119
|
cache: policies.cache,
|
|
3120
3120
|
canRead: canRead,
|
|
3121
3121
|
readField: function () {
|
|
3122
|
-
return policies.readField(normalizeReadFieldOptions(arguments, objectOrReference,
|
|
3122
|
+
return policies.readField(normalizeReadFieldOptions(arguments, objectOrReference, variables), context);
|
|
3123
3123
|
},
|
|
3124
3124
|
mergeObjects: makeMergeObjectsFunction(context.store),
|
|
3125
3125
|
};
|
|
@@ -4331,7 +4331,7 @@ var ObservableQuery = (function (_super) {
|
|
|
4331
4331
|
};
|
|
4332
4332
|
if (!useDisposableConcast) {
|
|
4333
4333
|
if (this.concast && this.observer) {
|
|
4334
|
-
this.concast.removeObserver(this.observer
|
|
4334
|
+
this.concast.removeObserver(this.observer);
|
|
4335
4335
|
}
|
|
4336
4336
|
this.concast = concast;
|
|
4337
4337
|
this.observer = observer;
|
|
@@ -6300,7 +6300,7 @@ var InternalState = (function () {
|
|
|
6300
6300
|
this.watchQueryOptions = watchQueryOptions;
|
|
6301
6301
|
if (currentWatchQueryOptions && this.observable) {
|
|
6302
6302
|
this.optionsToIgnoreOnce.delete(currentWatchQueryOptions);
|
|
6303
|
-
this.observable.reobserve(
|
|
6303
|
+
this.observable.reobserve(this.getObsQueryOptions());
|
|
6304
6304
|
this.previousData = ((_a = this.result) === null || _a === void 0 ? void 0 : _a.data) || this.previousData;
|
|
6305
6305
|
this.result = void 0;
|
|
6306
6306
|
}
|
|
@@ -6321,6 +6321,17 @@ var InternalState = (function () {
|
|
|
6321
6321
|
this.result = void 0;
|
|
6322
6322
|
}
|
|
6323
6323
|
};
|
|
6324
|
+
InternalState.prototype.getObsQueryOptions = function () {
|
|
6325
|
+
var toMerge = [];
|
|
6326
|
+
var globalDefaults = this.client.defaultOptions.watchQuery;
|
|
6327
|
+
if (globalDefaults)
|
|
6328
|
+
toMerge.push(globalDefaults);
|
|
6329
|
+
if (this.queryHookOptions.defaultOptions) {
|
|
6330
|
+
toMerge.push(this.queryHookOptions.defaultOptions);
|
|
6331
|
+
}
|
|
6332
|
+
toMerge.push(compact(this.observable && this.observable.options, this.watchQueryOptions));
|
|
6333
|
+
return toMerge.reduce(mergeOptions);
|
|
6334
|
+
};
|
|
6324
6335
|
InternalState.prototype.createWatchQueryOptions = function (_a) {
|
|
6325
6336
|
var _b;
|
|
6326
6337
|
if (_a === void 0) { _a = {}; }
|
|
@@ -6361,7 +6372,7 @@ var InternalState = (function () {
|
|
|
6361
6372
|
this.renderPromises
|
|
6362
6373
|
&& this.renderPromises.getSSRObservable(this.watchQueryOptions)
|
|
6363
6374
|
|| this.observable
|
|
6364
|
-
|| this.client.watchQuery(
|
|
6375
|
+
|| this.client.watchQuery(this.getObsQueryOptions());
|
|
6365
6376
|
this.obsQueryFields = React.useMemo(function () { return ({
|
|
6366
6377
|
refetch: obsQuery.refetch.bind(obsQuery),
|
|
6367
6378
|
reobserve: obsQuery.reobserve.bind(obsQuery),
|
|
@@ -6411,7 +6422,7 @@ var InternalState = (function () {
|
|
|
6411
6422
|
if (queryResult)
|
|
6412
6423
|
return queryResult;
|
|
6413
6424
|
var data = result.data; result.partial; var resultWithoutPartial = tslib.__rest(result, ["data", "partial"]);
|
|
6414
|
-
this.toQueryResultCache.set(result, queryResult = tslib.__assign(tslib.__assign(tslib.__assign({ data: data }, resultWithoutPartial), this.obsQueryFields), { client: this.client, observable: this.observable, variables: this.observable.variables, called:
|
|
6425
|
+
this.toQueryResultCache.set(result, queryResult = tslib.__assign(tslib.__assign(tslib.__assign({ data: data }, resultWithoutPartial), this.obsQueryFields), { client: this.client, observable: this.observable, variables: this.observable.variables, called: !this.queryHookOptions.skip, previousData: this.previousData }));
|
|
6415
6426
|
if (!queryResult.error && isNonEmptyArray(result.errors)) {
|
|
6416
6427
|
queryResult.error = new ApolloError({ graphQLErrors: result.errors });
|
|
6417
6428
|
}
|