@apollo/client
Version:
A fully-featured caching GraphQL client.
36 lines (35 loc) • 1.63 kB
text/typescript
import type { SelectionSetNode } from "graphql";
import type { Reference, StoreObject } from "@apollo/client/utilities";
import { handleIncrementalSymbol } from "@apollo/client/utilities/internal";
import type { Cache } from "../core/types/Cache.cjs";
import type { InMemoryCache } from "./inMemoryCache.cjs";
import type { DiffIncrementalInfo, DiffQueryAgainstStoreOptions, InMemoryCacheConfig, ReadMergeModifyContext } from "./types.cjs";
interface StoreReaderConfig {
cache: InMemoryCache;
fragments?: InMemoryCacheConfig["fragments"];
}
export declare class StoreReader {
private executeSelectionSet;
private executeSubSelectedArray;
private prunePartialStreamArray;
private prunePartialBoundaries;
private config;
private knownResults;
private keyMaker;
constructor(config: StoreReaderConfig);
/**
* Given a store and a query, return as much of the result as possible and
* identify if any data was missing from the store.
*/
diffQueryAgainstStore<T>(options: DiffQueryAgainstStoreOptions & {
[handleIncrementalSymbol]: DiffIncrementalInfo | undefined;
}): Cache.InternalDiffResultWithDataState<T>;
diffQueryAgainstStore<T>(options: DiffQueryAgainstStoreOptions): Cache.DiffResult<T>;
isFresh(result: Record<string, any>, parent: StoreObject | Reference, selectionSet: SelectionSetNode, context: ReadMergeModifyContext): boolean;
private execSelectionSetImpl;
private execSubSelectedArrayImpl;
private prunePartialBoundariesImpl;
private prunePartialStreamArrayImpl;
}
export {};
//# sourceMappingURL=readFromStore.d.cts.map