@graphql-mesh/cache-redis
Version:
16 lines (15 loc) • 742 B
TypeScript
import { type HivePubSub, type KeyValueCache, type KeyValueCacheSetOptions, type Logger, type MeshPubSub, type YamlConfig } from '@graphql-mesh/types';
import { DisposableSymbols } from '@whatwg-node/disposablestack';
export default class RedisCache<V = string> implements KeyValueCache<V>, Disposable {
private client;
private tracer;
constructor(options: YamlConfig.Cache['redis'] & {
pubsub?: MeshPubSub | HivePubSub;
logger: Logger;
});
[DisposableSymbols.dispose](): void;
set(key: string, value: V, options?: KeyValueCacheSetOptions): Promise<any>;
get(key: string): Promise<V | undefined>;
getKeysByPrefix(prefix: string): Promise<string[]>;
delete(key: string): Promise<boolean>;
}