@apollo/client 4.3.0-alpha.5 → 4.3.0-alpha.6
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/CHANGELOG.md +10 -0
- package/__cjs/cache/core/cache.cjs +1 -1
- package/__cjs/cache/inmemory/policies.cjs +24 -2
- package/__cjs/cache/inmemory/policies.cjs.map +1 -1
- package/__cjs/cache/inmemory/readFromStore.cjs +3 -3
- package/__cjs/cache/inmemory/readFromStore.cjs.map +1 -1
- package/__cjs/cache/inmemory/writeToStore.cjs +4 -4
- package/__cjs/core/ObservableQuery.cjs +10 -9
- package/__cjs/core/ObservableQuery.cjs.map +1 -1
- package/__cjs/core/ObservableQuery.d.cts +1 -1
- package/__cjs/core/QueryInfo.cjs +2 -11
- package/__cjs/core/QueryInfo.cjs.map +1 -1
- package/__cjs/core/QueryInfo.d.cts +2 -2
- package/__cjs/core/QueryManager.cjs +14 -11
- package/__cjs/core/QueryManager.cjs.map +1 -1
- package/__cjs/invariantErrorCodes.cjs +13 -8
- package/__cjs/utilities/internal/index.cjs +3 -1
- package/__cjs/utilities/internal/index.cjs.map +1 -1
- package/__cjs/utilities/internal/index.d.cts +1 -0
- package/__cjs/utilities/internal/toDiffWithDataState.cjs +20 -0
- package/__cjs/utilities/internal/toDiffWithDataState.cjs.map +1 -0
- package/__cjs/utilities/internal/toDiffWithDataState.d.cts +8 -0
- package/__cjs/version.cjs +1 -1
- package/cache/core/cache.js +1 -1
- package/cache/inmemory/policies.js +24 -2
- package/cache/inmemory/policies.js.map +1 -1
- package/cache/inmemory/readFromStore.js +3 -3
- package/cache/inmemory/readFromStore.js.map +1 -1
- package/cache/inmemory/writeToStore.js +4 -4
- package/core/ObservableQuery.d.ts +1 -1
- package/core/ObservableQuery.js +11 -10
- package/core/ObservableQuery.js.map +1 -1
- package/core/QueryInfo.d.ts +2 -2
- package/core/QueryInfo.js +3 -12
- package/core/QueryInfo.js.map +1 -1
- package/core/QueryManager.js +14 -11
- package/core/QueryManager.js.map +1 -1
- package/invariantErrorCodes.js +13 -8
- package/package.json +1 -1
- package/utilities/internal/index.d.ts +1 -0
- package/utilities/internal/index.js +1 -0
- package/utilities/internal/index.js.map +1 -1
- package/utilities/internal/toDiffWithDataState.d.ts +8 -0
- package/utilities/internal/toDiffWithDataState.js +17 -0
- package/utilities/internal/toDiffWithDataState.js.map +1 -0
- package/version.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @apollo/client
|
|
2
2
|
|
|
3
|
+
## 4.3.0-alpha.6
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#13405](https://github.com/apollographql/apollo-client/pull/13405) [`f923ab4`](https://github.com/apollographql/apollo-client/commit/f923ab422e1bcd35c1bcd2939f58dc3723508b55) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Field policy `read` and `merge` functions are now ignored when the field policy configures the `scalar` option. If a `read` or `merge` function is provided alongside `scalar`, a development-only warning is emitted.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- [#13408](https://github.com/apollographql/apollo-client/pull/13408) [`7a5164d`](https://github.com/apollographql/apollo-client/commit/7a5164d3ce21b7f88f625588ec72dbce8ea33810) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Fix `dataState` to report `"streaming"` instead of `"partial"` when `returnPartialData` is `true` and the cache result is missing only `@defer` fields.
|
|
12
|
+
|
|
3
13
|
## 4.3.0-alpha.5
|
|
4
14
|
|
|
5
15
|
### Minor Changes
|
|
@@ -147,7 +147,7 @@ class ApolloCache {
|
|
|
147
147
|
if (environment_1.__DEV__) {
|
|
148
148
|
const actualFragmentName = fragmentName || (0, internal_1.getFragmentDefinition)(fragment).name.value;
|
|
149
149
|
if (id === undefined) {
|
|
150
|
-
__DEV__ && invariant_1.invariant.warn(
|
|
150
|
+
__DEV__ && invariant_1.invariant.warn(121, actualFragmentName);
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
153
|
return id;
|
|
@@ -194,13 +194,32 @@ class Policies {
|
|
|
194
194
|
}
|
|
195
195
|
const incoming = fields[fieldName];
|
|
196
196
|
if (typeof incoming === "function") {
|
|
197
|
-
existing.
|
|
197
|
+
if (existing.scalar) {
|
|
198
|
+
if (environment_1.__DEV__) {
|
|
199
|
+
warnAboutScalarConfig(typename, fieldName, existing.scalar, "read");
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
else {
|
|
203
|
+
existing.read = incoming;
|
|
204
|
+
}
|
|
198
205
|
}
|
|
199
206
|
else {
|
|
200
|
-
|
|
207
|
+
let { keyArgs, read, merge, scalar } = incoming;
|
|
201
208
|
if (scalar) {
|
|
202
209
|
existing.scalar = scalar;
|
|
203
210
|
}
|
|
211
|
+
if (existing.scalar) {
|
|
212
|
+
if (environment_1.__DEV__) {
|
|
213
|
+
if (read !== undefined || existing.read !== undefined) {
|
|
214
|
+
warnAboutScalarConfig(typename, fieldName, existing.scalar, "read");
|
|
215
|
+
}
|
|
216
|
+
if (merge !== undefined || existing.merge !== undefined) {
|
|
217
|
+
warnAboutScalarConfig(typename, fieldName, existing.scalar, "merge");
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
existing.read = read = undefined;
|
|
221
|
+
existing.merge = merge = undefined;
|
|
222
|
+
}
|
|
204
223
|
existing.keyFn =
|
|
205
224
|
// Pass false to disable argument-based differentiation of
|
|
206
225
|
// field identities.
|
|
@@ -678,4 +697,7 @@ function makeMergeObjectsFunction(store) {
|
|
|
678
697
|
return incoming;
|
|
679
698
|
};
|
|
680
699
|
}
|
|
700
|
+
function warnAboutScalarConfig(typename, fieldName, scalar, kind) {
|
|
701
|
+
__DEV__ && invariant_1.invariant.warn(113, `${typename}.${fieldName}`, scalar, kind);
|
|
702
|
+
}
|
|
681
703
|
//# sourceMappingURL=policies.cjs.map
|