Q33: What are Automatic Persisted Queries (APQ)?
APQ optimizes network transfer and caching:
- Client sends a cryptographic hash (SHA-256) of the query instead of the full string.
- If the server recognizes the hash in its lookup cache, it executes the operation immediately.
- If unknown, the server responds with
PersistedQueryNotFound, prompting the client to send the full query text once to register the hash.
Key Takeaways
- APQ drastically reduces HTTP payload sizes by substituting query strings with cryptographic hashes.
- It allows caching GraphQL queries via GET requests using hashed identifiers.
Knowledge Check
What is transmitted on the first attempt in an Automatic Persisted Query protocol?