Type alias RequestPolicy

RequestPolicy: "cache-first" | "cache-and-network" | "network-only" | "cache-only"

The request and caching strategy that is used by exchanges to retrive cached results.


The RequestPolicy is used by cache exchanges to decide how a query operation may be resolved with cached results.h A cache exchange may behave differently depending on which policy is returned.

  • cache-first (the default) prefers cached results and falls back to sending an API request.
  • cache-and-network returns cached results but also always sends an API request in the background.
  • network-only will ignore any cached results and send an API request.
  • cache-only will always return cached results and prevent API requests.

Generated using TypeDoc