v0Cache StoragesCF Workers KV
⚠️
This is the documentation for the old GraphQL Mesh version v0. We recommend upgrading to the latest GraphQL Mesh version v1.

Migrate to GraphQL Mesh v1

CloudFlare Workers KV

If you are using Mesh on Cloudflare Workers, you can use KV as a storage.

To get started with this caching strategy, install it:

npm i @graphql-mesh/cache-cf-kw

How to use?

.meshrc.yaml
cache:
  cf-kw:
    namespace: MY_MESH_CACHE

If you need help with deploying GraphQL Mesh on CloudFlare Workers, see our deployment recipes.

Config API Reference

  • namespace (type: String, required) - The name of the Workers KV namespace to use for caching.

Make sure you have configured the following namespace described in here.

Example

You can check this example to see how to use KV stores for caching in GraphQL Mesh; https://github.com/ardatan/graphql-mesh/tree/master/examples/cloudflare-workers