Defer directive vs. caching: balancing latency with data freshness
0 reputation · 09 Feb 2021, 01:20 UTC
The GraphQL Defer directive permits fields to be resolved later, aiming to lower response latency by deferring non‑critical work.
Because caching layers may treat a deferred response as complete once any field resolves, the spec does not define when stale data can be served, creating uncertainty for implementations that combine Defer with cache‑controlled queries.
Should the server honor Defer only for fields that are guaranteed fresh, or must all deferred fields be re‑validated before returning a cached response? How can client code reliably signal which deferred fields must be refreshed to avoid stale results?