UNPKG

1.44 kBTypeScriptView Raw
1import { SelectionSetNode } from 'graphql';
2import { Reference, StoreObject } from '../../utilities';
3import { Cache } from '../core/types/Cache';
4import { DiffQueryAgainstStoreOptions, InMemoryCacheConfig, ReadMergeModifyContext } from './types';
5import { InMemoryCache } from './inMemoryCache';
6import { MissingTree } from '../core/types/common';
7import { ObjectCanon } from './object-canon';
8export declare type VariableMap = {
9 [name: string]: any;
10};
11export declare type ExecResult<R = any> = {
12 result: R;
13 missing?: MissingTree;
14};
15export interface StoreReaderConfig {
16 cache: InMemoryCache;
17 addTypename?: boolean;
18 resultCacheMaxSize?: number;
19 canonizeResults?: boolean;
20 canon?: ObjectCanon;
21 fragments?: InMemoryCacheConfig["fragments"];
22}
23export declare class StoreReader {
24 private executeSelectionSet;
25 private executeSubSelectedArray;
26 private config;
27 private knownResults;
28 canon: ObjectCanon;
29 resetCanon(): void;
30 constructor(config: StoreReaderConfig);
31 diffQueryAgainstStore<T>({ store, query, rootId, variables, returnPartialData, canonizeResults, }: DiffQueryAgainstStoreOptions): Cache.DiffResult<T>;
32 isFresh(result: Record<string, any>, parent: StoreObject | Reference, selectionSet: SelectionSetNode, context: ReadMergeModifyContext): boolean;
33 private execSelectionSetImpl;
34 private execSubSelectedArrayImpl;
35}
36//# sourceMappingURL=readFromStore.d.ts.map
\No newline at end of file