@apollo/client
Version:
A fully-featured caching GraphQL client.
35 lines • 1.62 kB
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.js";
import type { InMemoryCache } from "./inMemoryCache.js";
import type { DiffIncrementalInfo, DiffQueryAgainstStoreOptions, InMemoryCacheConfig, ReadMergeModifyContext } from "./types.js";
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.ts.map