Our solution
Register automatically, cache at the edge
APQ removes the upfront registration step. Queries are cached the first time a client sends them. After that, clients send only the SHA-256 hash—making GET-based CDN caching possible for any query.
How APQ works end to end
The client sends the full query body alongside its SHA-256 hash in the `extensions.persistedQuery` parameter.
The router receives the request, finds no cached entry for this hash, stores the query-to-hash mapping, and executes the operation.
On subsequent requests, the client sends only the hash—no query body. The router retrieves the stored operation and executes it.
GET requests with only the hash parameter are CDN-cacheable. CDN edge nodes serve cached responses without forwarding to origin.
If the hash is not found (first request, or a router instance that has not cached it yet), the router does not recognize it and the request fails. The client resends with the full body to register it.
Storage is in-memory by default. Redis provides persistence across router restarts and sharing across multiple router instances.
No CI/CD changes. No manifest files. Zero-friction adoption.

