1 | import { SelectionSetNode, FieldNode, DocumentNode } from 'graphql';
|
2 | import { FragmentMatcher } from './readFromStore';
|
3 | import { FragmentMap } from 'apollo-utilities';
|
4 | import { IdGetter, NormalizedCache } from './types';
|
5 | export declare class WriteError extends Error {
|
6 | type: string;
|
7 | }
|
8 | export declare function enhanceErrorWithDocument(error: Error, document: DocumentNode): WriteError;
|
9 | export declare type WriteContext = {
|
10 | readonly store: NormalizedCache;
|
11 | readonly processedData?: {
|
12 | [x: string]: FieldNode[];
|
13 | };
|
14 | readonly variables?: any;
|
15 | readonly dataIdFromObject?: IdGetter;
|
16 | readonly fragmentMap?: FragmentMap;
|
17 | readonly fragmentMatcherFunction?: FragmentMatcher;
|
18 | };
|
19 | export declare class StoreWriter {
|
20 | writeQueryToStore({ query, result, store, variables, dataIdFromObject, fragmentMatcherFunction, }: {
|
21 | query: DocumentNode;
|
22 | result: Object;
|
23 | store?: NormalizedCache;
|
24 | variables?: Object;
|
25 | dataIdFromObject?: IdGetter;
|
26 | fragmentMatcherFunction?: FragmentMatcher;
|
27 | }): NormalizedCache;
|
28 | writeResultToStore({ dataId, result, document, store, variables, dataIdFromObject, fragmentMatcherFunction, }: {
|
29 | dataId: string;
|
30 | result: any;
|
31 | document: DocumentNode;
|
32 | store?: NormalizedCache;
|
33 | variables?: Object;
|
34 | dataIdFromObject?: IdGetter;
|
35 | fragmentMatcherFunction?: FragmentMatcher;
|
36 | }): NormalizedCache;
|
37 | writeSelectionSetToStore({ result, dataId, selectionSet, context, }: {
|
38 | dataId: string;
|
39 | result: any;
|
40 | selectionSet: SelectionSetNode;
|
41 | context: WriteContext;
|
42 | }): NormalizedCache;
|
43 | private writeFieldToStore;
|
44 | private processArrayValue;
|
45 | }
|
46 |
|
\ | No newline at end of file |