1 | import { SelectionSetNode, FieldNode } from 'graphql';
|
2 | import { FragmentMap, FragmentMapFunction, StoreObject, Reference } from '../../utilities';
|
3 | import { NormalizedCache, ReadMergeModifyContext, MergeTree } from './types';
|
4 | import { StoreReader } from './readFromStore';
|
5 | import { InMemoryCache } from './inMemoryCache';
|
6 | import { Cache } from '../../core';
|
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?: import("./fragmentRegistry").FragmentRegistryAPI | undefined);
|
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 |