@apollo/client 4.3.4 → 4.3.5
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/inmemory/helpers.cjs +5 -0
- package/__cjs/cache/inmemory/helpers.cjs.map +1 -1
- package/__cjs/cache/inmemory/inMemoryCache.cjs +2 -1
- package/__cjs/cache/inmemory/inMemoryCache.cjs.map +1 -1
- package/__cjs/cache/inmemory/key-extractor.cjs +14 -2
- package/__cjs/cache/inmemory/key-extractor.cjs.map +1 -1
- package/__cjs/cache/inmemory/policies.cjs +16 -0
- package/__cjs/cache/inmemory/policies.cjs.map +1 -1
- package/__cjs/cache/inmemory/policies.d.cts +2 -0
- package/__cjs/cache/inmemory/writeToStore.cjs +3 -2
- package/__cjs/cache/inmemory/writeToStore.cjs.map +1 -1
- package/__cjs/core/QueryInfo.cjs +9 -1
- package/__cjs/core/QueryInfo.cjs.map +1 -1
- package/__cjs/core/QueryInfo.d.cts +1 -1
- package/__cjs/core/QueryManager.cjs +10 -3
- package/__cjs/core/QueryManager.cjs.map +1 -1
- package/__cjs/react/hooks/useFragment.cjs.map +1 -1
- package/__cjs/react/hooks/useFragment.d.cts +42 -43
- package/__cjs/version.cjs +1 -1
- package/cache/inmemory/helpers.js +5 -0
- package/cache/inmemory/helpers.js.map +1 -1
- package/cache/inmemory/inMemoryCache.js +2 -1
- package/cache/inmemory/inMemoryCache.js.map +1 -1
- package/cache/inmemory/key-extractor.js +14 -2
- package/cache/inmemory/key-extractor.js.map +1 -1
- package/cache/inmemory/policies.d.ts +2 -0
- package/cache/inmemory/policies.js +17 -1
- package/cache/inmemory/policies.js.map +1 -1
- package/cache/inmemory/writeToStore.js +3 -2
- package/cache/inmemory/writeToStore.js.map +1 -1
- package/core/QueryInfo.d.ts +1 -1
- package/core/QueryInfo.js +10 -2
- package/core/QueryInfo.js.map +1 -1
- package/core/QueryManager.js +10 -3
- package/core/QueryManager.js.map +1 -1
- package/package.json +1 -1
- package/react/hooks/useFragment.d.ts +42 -43
- package/react/hooks/useFragment.js.map +1 -1
- package/react/hooks-compiled/useFragment.d.ts +42 -43
- package/react/hooks-compiled/useFragment.js.map +1 -1
- package/version.js +1 -1
|
@@ -19,6 +19,7 @@ export type KeyFieldsContext = {
|
|
|
19
19
|
selectionSet?: SelectionSetNode;
|
|
20
20
|
fragmentMap?: FragmentMap;
|
|
21
21
|
keyObject?: Record<string, any>;
|
|
22
|
+
serializeKeyField?: (typename: string, fieldName: string, value: unknown) => unknown;
|
|
22
23
|
};
|
|
23
24
|
export type KeyFieldsFunction = (object: Readonly<StoreObject>, context: KeyFieldsContext) => KeySpecifier | false | ReturnType<IdGetter>;
|
|
24
25
|
export type TypePolicy = {
|
|
@@ -118,6 +119,7 @@ export declare class Policies {
|
|
|
118
119
|
hasKeyArgs(typename: string | undefined, fieldName: string): boolean;
|
|
119
120
|
getStoreFieldName(fieldSpec: FieldSpecifier): string;
|
|
120
121
|
getScalarTypeForField(typename: string, fieldName: string): ScalarType | undefined;
|
|
122
|
+
private serializeScalarValue;
|
|
121
123
|
readField<V = StoreValue>(options: ReadFieldOptions, context: ReadMergeModifyContext): SafeReadonly<V> | undefined;
|
|
122
124
|
getReadFunction(typename: string | undefined, fieldName: string): FieldReadFunction | undefined;
|
|
123
125
|
getMergeFunction(parentTypename: string | undefined, fieldName: string, childTypename: string | undefined): FieldMergeFunction | undefined;
|
|
@@ -262,8 +262,9 @@ class StoreWriter {
|
|
|
262
262
|
// Write any key fields that were used during identification, even if
|
|
263
263
|
// they were not mentioned in the original query.
|
|
264
264
|
if (keyObject) {
|
|
265
|
-
//
|
|
266
|
-
|
|
265
|
+
// Values in incoming take precedence over keyObject, which may contain
|
|
266
|
+
// serialized values used to compute the ID.
|
|
267
|
+
incoming = context.merge(keyObject, incoming);
|
|
267
268
|
}
|
|
268
269
|
}
|
|
269
270
|
catch (e) {
|