1 | import type { SelectionSetNode, FieldNode } from "graphql";
|
2 | import type { FragmentMap, FragmentMapFunction, StoreObject, Reference } from "../../utilities/index.js";
|
3 | import type { NormalizedCache, ReadMergeModifyContext, MergeTree, InMemoryCacheConfig } from "./types.js";
|
4 | import type { StoreReader } from "./readFromStore.js";
|
5 | import type { InMemoryCache } from "./inMemoryCache.js";
|
6 | import type { Cache } from "../../core/index.js";
|
7 | export interface WriteContext extends ReadMergeModifyContext {
|
8 | readonly written: {
|
9 | [dataId: string]: SelectionSetNode[];
|
10 | };
|
11 | readonly fragmentMap: FragmentMap;
|
12 | lookupFragment: FragmentMapFunction;
|
13 | merge<T>(existing: T, incoming: T): T;
|
14 | overwrite: boolean;
|
15 | incomingById: Map<string, {
|
16 | storeObject: StoreObject;
|
17 | mergeTree?: MergeTree;
|
18 | fieldNodeSet: Set<FieldNode>;
|
19 | }>;
|
20 | clientOnly: boolean;
|
21 | deferred: boolean;
|
22 | flavors: Map<string, FlavorableWriteContext>;
|
23 | }
|
24 | type FlavorableWriteContext = Pick<WriteContext, "clientOnly" | "deferred" | "flavors">;
|
25 | export declare class StoreWriter {
|
26 | readonly cache: InMemoryCache;
|
27 | private reader?;
|
28 | private fragments?;
|
29 | constructor(cache: InMemoryCache, reader?: StoreReader | undefined, fragments?: InMemoryCacheConfig["fragments"]);
|
30 | writeToStore(store: NormalizedCache, { query, result, dataId, variables, overwrite }: Cache.WriteOptions): Reference | undefined;
|
31 | private processSelectionSet;
|
32 | private processFieldValue;
|
33 | private flattenFields;
|
34 | private applyMerges;
|
35 | }
|
36 | export {};
|
37 |
|
\ | No newline at end of file |