The timestamp for when the query most recently returned the status
as "success"
.
The error object for the query, if an error was thrown.
null
.The sum of all errors.
The timestamp for when the query most recently returned the status
as "error"
.
The failure count for the query.
0
when the query succeeds.The failure reason for the query retry.
null
when the query succeeds.The fetch status of the query.
fetching
: Is true
whenever the queryFn is executing, which includes initial pending
as well as background refetch.paused
: The query wanted to fetch, but has been paused
.idle
: The query is not fetching.A derived boolean from the status
variable, provided for convenience.
true
if the query attempt resulted in an error.Will be true
if the query has been fetched.
Will be true
if the query has been fetched after the component mounted.
A derived boolean from the fetchStatus
variable, provided for convenience.
true
whenever the queryFn
is executing, which includes initial pending
as well as background refetch.Is true
whenever the first fetch for a query is in-flight.
isFetching && isPending
.Will be true
if the query failed while fetching for the first time.
A derived boolean from the fetchStatus
variable, provided for convenience.
paused
.Will be pending
if there's no cached data and no query attempt was finished yet.
Will be true
if the data shown is the placeholder data.
Will be true
if the query failed while refetching.
Is true
whenever a background refetch is in-flight, which does not include initial pending
.
isFetching && !isPending
.Will be true
if the data in the cache is invalidated or if the data is older than the given staleTime
.
A derived boolean from the status
variable, provided for convenience.
true
if the query has received a response with no errors and is ready to display its data.A function to manually refetch the query.
The status of the query.
pending
if there's no cached data and no query attempt was finished yet.error
if the query attempt resulted in an error.success
if the query has received a response with no errors and is ready to display its data.
The last successfully resolved data for the query.