Persisted / Automatic Persisted Queries (APQ)
Mobile clients ship with query hash only; server maps hash → full query text. Benefits:
- Smaller payloads
- Allowlist — unknown hashes rejected (security)
- CDN-friendly GET requests for reads (
?extensions={\"persistedQuery\":{\"sha256Hash\":\"...\"}})
Requires release pipeline to register queries.
@defer and @stream (incremental delivery)
Return partial data first, later patches for slow fields — improves perceived latency on mobile.
Operational cost: more complex execution engine, caching interactions.
Subscription scaling
Architecture:
Kafka topic → subscription service → WebSocket fan-out → N clients
Challenges:
- Connection count per pod (file descriptors, memory)
- Auth refresh on long connections
- Fan-out when one event → 10k subscribers — partition by shard/key
- Backpressure when client reads slowly — drop vs buffer (memory risk)
Federation tuning
- Entity resolver batching across subgraphs
- Query plan caching at gateway
- Schema composition CI with breaking change detection (Rover)
GraphQL at staff interviews
Discuss operational guardrails (cost analysis, APQ, timeout) not just schema design — distinguishes senior from mid.
Further Reading
- Apollo — Automatic Persisted QueriesReference20m
- GraphQL — Incremental Delivery (@defer, @stream)Reference15m