@graphql-mesh/cache-redis
Version:
13 lines (12 loc) • 548 B
text/typescript
import { KeyValueCache, KeyValueCacheSetOptions, Logger, MeshPubSub, YamlConfig } from '@graphql-mesh/types';
export default class RedisCache<V = string> implements KeyValueCache<V> {
private client;
constructor(options: YamlConfig.Cache['redis'] & {
pubsub: MeshPubSub;
logger: Logger;
});
set(key: string, value: V, options?: KeyValueCacheSetOptions): Promise<void>;
get(key: string): Promise<V | undefined>;
getKeysByPrefix(prefix: string): Promise<string[]>;
delete(key: string): Promise<boolean>;
}