1 | import type { SelectionSetNode } from "graphql";
|
2 | import type { Reference, StoreObject } from "../../utilities/index.js";
|
3 | import type { Cache } from "../core/types/Cache.js";
|
4 | import type { DiffQueryAgainstStoreOptions, InMemoryCacheConfig, ReadMergeModifyContext } from "./types.js";
|
5 | import type { InMemoryCache } from "./inMemoryCache.js";
|
6 | import type { MissingTree } from "../core/types/common.js";
|
7 | import { ObjectCanon } from "./object-canon.js";
|
8 | export type VariableMap = {
|
9 | [name: string]: any;
|
10 | };
|
11 | export type ExecResult<R = any> = {
|
12 | result: R;
|
13 | missing?: MissingTree;
|
14 | };
|
15 | export interface StoreReaderConfig {
|
16 | cache: InMemoryCache;
|
17 | addTypename?: boolean;
|
18 | resultCacheMaxSize?: number;
|
19 | canonizeResults?: boolean;
|
20 | canon?: ObjectCanon;
|
21 | fragments?: InMemoryCacheConfig["fragments"];
|
22 | }
|
23 | export 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 | /**
|
32 | * Given a store and a query, return as much of the result as possible and
|
33 | * identify if any data was missing from the store.
|
34 | */
|
35 | diffQueryAgainstStore<T>({ store, query, rootId, variables, returnPartialData, canonizeResults, }: DiffQueryAgainstStoreOptions): Cache.DiffResult<T>;
|
36 | isFresh(result: Record<string, any>, parent: StoreObject | Reference, selectionSet: SelectionSetNode, context: ReadMergeModifyContext): boolean;
|
37 | private execSelectionSetImpl;
|
38 | private execSubSelectedArrayImpl;
|
39 | }
|
40 | //# sourceMappingURL=readFromStore.d.ts.map |
\ | No newline at end of file |