UNPKG

@envelop/response-cache-cloudflare-kv

Version:

- Supports [Cloudflare KV](https://developers.cloudflare.com/kv/) cache for `@envelop/response-cache` plugin - Suitable for graphql servers running on [Cloudflare Workers](https://workers.cloudflare.com/)

13 lines (12 loc) 548 B
import type { ExecutionResult } from 'graphql'; import { KVNamespace } from '@cloudflare/workers-types'; import type { CacheEntityRecord } from '@envelop/response-cache'; export declare function set( /** id/hash of the operation */ id: string, /** the result that should be cached */ data: ExecutionResult, /** array of entity records that were collected during execution */ entities: Iterable<CacheEntityRecord>, /** how long the operation should be cached (in milliseconds) */ ttl: number, KV: KVNamespace, keyPrefix?: string): Promise<void>;