πŸ•ΈοΈ API Patterns and Practices: GraphQL
Home Chapters Examples Diagrams Bibliography GitHub β†—
Home / Performance & Safety
Part 7 3 chapters

Performance & Safety

Bound what a client can ask for with depth limits, cost analysis, persisted queries and caching.

Chapter 14

Depth limits and query cost analysis

Bounding what a client can ask for: depth, token and alias limits, and a list-aware cost budget enforced on graphql-java and on Strawberry before any source call.

12 min readRead β†’
Chapter 15

Persisted queries and APQ

Replacing query text with a SHA-256 hash: Apollo's APQ handshake, hashes that do not match their text, persisted queries over GET, trusted documents as an allowlist, and where each stack resolves the document.

13 min readRead β†’
Chapter 16

Caching

Four places to keep an answer: the client's normalized cache, an HTTP edge fed by persisted GET URLs, field caches under the loaders, and the sources, with Cache-Control decided per response and invalidation on write.

13 min readRead β†’
← Previous part Data Fetching at Scale Next part β†’ Security

API Patterns and Practices: GraphQL

Designing GraphQL APIs well, with runnable examples in Quarkus SmallRye GraphQL and Python Strawberry against one canonical SDL contract.

Site

  • Outline
  • Bibliography

Reference

  • GraphQL β†—
  • GraphQL specification β†—
  • SmallRye GraphQL β†—
  • Strawberry β†—
  • View on GitHub β†—
  • Issues β†—
Open source Β· MIT Last built 2026-11-11