Caching that reads your schema
The problem
Hand-written cache rules grow into a second schema you have to keep in sync: a type gets renamed in the code, a new type has no rule yet, and nobody notices until a purge misses.
With GraphPilot
GraphQL was built around a schema from day one, and GraphPilot reads caching from it. A field of type ID or named id is a key on its own; register your own scalar, such as ISBN, with @surrogateKey on the scalar or one line in gpilot.toml, and every field of that type is a key too. @surrogateKey also marks a key field, a composite key, a value objects share, or a static group you purge by name. Put a key on an interface or a union once, and every type that has the field carries it. @cacheControl sets the lifetime next to it. The rules ship, get reviewed and change with your code.
Docs: What purges together ↗Transcript
GraphQL was built around a schema from day one: every API describes its types and fields up front.
So why keep your cache rules in a second file, one you have to keep in sync?
Every new type or field needs another rule there, checked by someone else.
With GraphPilot, any field of type ID is a key on its own. Register your own scalar, like ISBN, with one directive (scalar ISBN @surrogateKey), or one line of gpilot.toml.
Another field as the key? Mark it: slug: String! @surrogateKey.
A price per store? Combine two fields into one key.
Every book by one author? Key the type by the author's ID: @surrogateKey(of: "author.id").
Put it on an interface or a union once, and every type that has the field carries it.
A group you clear by name, like the bestseller list, gets a static key: @surrogateKey(static: "bestsellers").
And lifetimes sit right next to it: @cacheControl(maxAge: 300).
Now rename the ISBN field. A separate config would point at nothing. The key in your schema moves with the code.
Your schema already describes your data. GraphPilot reads caching from it, so the rules ship, get reviewed, and change with your code.
Cleared for takeoff
Start on Glider (Free).
No credit card, no commitment.
Prefer to talk first? Book a call