Runnable GraphQL caching examples and integration guides for GraphPilot, the managed GraphQL edge cache.
Website · Documentation · Quickstart
GraphPilot sits in front of your GraphQL API and caches responses at the edge, close to your
clients. It takes cache lifetimes from your schema or your origin's Cache-Control header, and
when a mutation returns an object, it purges every cached response that contained that object.
The examples in this repository show that in practice. Each one comes with a GraphQL origin you can run on its own, without a GraphPilot account, and the steps to put GraphPilot in front of it.
A Book GraphQL API (GraphQL Yoga), called directly and through the GraphPilot edge cache, with the same queries and the same mutation on both endpoints.
- Compare cache
MISS,HITand mutation-driven invalidation between the direct origin and GraphPilot - Ready-made requests for the terminal, JetBrains IDEs and VS Code
- Ways to give the origin a public URL: a free tunnel (ngrok or Cloudflare), Render, or your own server
- A separate, hand-written in-memory cache for learning how GraphQL
POSTcaching works
Accompanies the article "How to Cache GraphQL POST Requests: A Practical Guide".
Every example lives in its own folder, with its own package.json and README:
git clone https://github.com/GraphPilot/examples.git
cd examples/graphql-post-caching
npm install
npm run originThe example's README takes it from there: running the requests, putting GraphPilot in front of the origin, and comparing both endpoints.
Requirements depend on the example; the GraphQL POST caching example needs Node.js 22.15 or newer.
| Path | What it is |
|---|---|
graphql-post-caching/ |
The GraphQL POST caching example |
render.yaml |
Render Blueprint behind the "Deploy to Render" button. It lives at the repository root because the button reads it there, and deploys only the Book origin of graphql-post-caching/ |
.github/assets/ |
Logos used in the READMEs |
- How GraphPilot works
- GraphQL quickstart: from a new account to a cached response
- When a response is cached
- Automatic invalidation