@apollo/client
Version:
A fully-featured caching GraphQL client.
36 lines • 1.43 kB
TypeScript
import { SelectionSetNode } from 'graphql';
import { Reference, StoreObject } from '../../utilities';
import { Cache } from '../core/types/Cache';
import { DiffQueryAgainstStoreOptions, InMemoryCacheConfig, ReadMergeModifyContext } from './types';
import { InMemoryCache } from './inMemoryCache';
import { MissingTree } from '../core/types/common';
import { ObjectCanon } from './object-canon';
export type VariableMap = {
[name: string]: any;
};
export type ExecResult<R = any> = {
result: R;
missing?: MissingTree;
};
export interface StoreReaderConfig {
cache: InMemoryCache;
addTypename?: boolean;
resultCacheMaxSize?: number;
canonizeResults?: boolean;
canon?: ObjectCanon;
fragments?: InMemoryCacheConfig["fragments"];
}
export declare class StoreReader {
private executeSelectionSet;
private executeSubSelectedArray;
private config;
private knownResults;
canon: ObjectCanon;
resetCanon(): void;
constructor(config: StoreReaderConfig);
diffQueryAgainstStore<T>({ store, query, rootId, variables, returnPartialData, canonizeResults, }: DiffQueryAgainstStoreOptions): Cache.DiffResult<T>;
isFresh(result: Record<string, any>, parent: StoreObject | Reference, selectionSet: SelectionSetNode, context: ReadMergeModifyContext): boolean;
private execSelectionSetImpl;
private execSubSelectedArrayImpl;
}
//# sourceMappingURL=readFromStore.d.ts.map