UNPKG

@quell/server

Version:

Quell is an open-source NPM package providing a light-weight caching layer implementation and cache invalidation for GraphQL responses on both the client- and server-side. Use Quell to prevent redundant client-side API requests and to minimize costly serv

26 lines 1.11 kB
import { RedisClientType } from "redis"; import type { ProtoObjType, ItemFromCacheType, IdCacheType } from "../types/types"; /** * Configuration interface for read cache operations */ export interface ReadCacheConfig { redisCache: RedisClientType; redisReadBatchSize: number; idCache: IdCacheType; generateCacheID: (queryProto: ProtoObjType) => string; } /** * Creates a buildFromCache function with the provided configuration * @param config - Configuration object containing Redis cache, batch size, and ID cache * @returns Bound buildFromCache function */ export declare function createBuildFromCache(config: ReadCacheConfig): (prototype: ProtoObjType, prototypeKeys: string[], itemFromCache?: ItemFromCacheType, firstRun?: boolean, subID?: boolean | string) => Promise<{ data: ItemFromCacheType; }>; /** * Creates a generateCacheID function * Helper function that creates cacheIDs based on information from the prototype * in the format of 'field--ID' */ export declare function createGenerateCacheID(): (queryProto: ProtoObjType) => string; //# sourceMappingURL=readCache.d.ts.map