May 30, 2024
theguild-bot
released this
30 May 09:49
·
54 commits
to main
since this release
@envelop/response-cache@6.2.0
Minor Changes
- #2238
430ee7d
Thanks @ardatan! - Accept a factory function tocache
that takes
the context and returns the cache implementation
@envelop/response-cache-cloudflare-kv@1.0.0
Minor Changes
-
#2238
430ee7d
Thanks @ardatan! - BREAKING: Now the cache implementation does not
require theExecutionContext
orKVNamespace
instance but only the name of the namespaceimport { createSchema, createYoga, YogaInitialContext } from 'graphql-yoga' import { useResponseCache } from '@envelop/response-cache' import { createKvCache } from '@envelop/response-cache-cloudflare-kv' import { resolvers } from './graphql-schema/resolvers.generated' import { typeDefs } from './graphql-schema/typeDefs.generated' export type Env = { GRAPHQL_RESPONSE_CACHE: KVNamespace } const graphqlServer = createYoga<Env & ExecutionContext>({ schema: createSchema({ typeDefs, resolvers }), plugins: [ useResponseCache({ cache: createKvCache({ KVName: 'GRAPHQL_RESPONSE_CACHE', keyPrefix: 'graphql' // optional }), session: () => null, includeExtensionMetadata: true, ttl: 1000 * 10 // 10 seconds }) ] }) export default { fetch: graphqlServer }
Patch Changes
- Updated dependencies
[430ee7d
]:- @envelop/response-cache@6.2.0