useQuery

The useQuery hook is a wrapper around useQuery from react-query. It supports Suspense calls on the server and on the client.

Example code

Arguments

The useQuery hook takes the following arguments:

Key Required Description
cacheKey Yes A string or an array to uniquely identify the query.
queryFn Yes An asynchronous function that returns data.
options No An object describing the options for the request.

The options object accepts the following properties:

Key Required Description
cache No An object describing the cache policy for the request.