Skip to main content

React API Reference

Fetch Policy#

Fetch policies allow you to have fine-grained control over your fetch behaviors

NameDescription
cache-firstClient executes the query against the cache, if all requested data is present in the cache, that data is returned.
Otherwise, it executes the query against your GraphQL server and returns the data after caching it.

Prioritizes minimizing the number of network requests sent by your application.
cache-and-networkClient executes the full query against both the cache and your GraphQL server.

Provides a fast response while also helping to keep cached data consistent with server data.
network-onlyClient executes the full query against your GraphQL server, without first checking the cache.

The query's result is stored in the cache.
no-cacheClient executes the full query against your GraphQL server, without first checking the cache.

The query's result is NOT stored in the cache.

Auto-generated#

You can check a more detailed API Reference made from the type definitions, auto-generated using TypeDoc:

Check Here

Last updated on by Sam Denty