Skip to main content
Version: v10.0.0

QueryState


Import
import { QueryState } from "@hyper-fetch/db"

Preview​

type QueryState<Data> = {
data: Data | undefined;
error: unknown;
hasNextPage: boolean;
isFetching: boolean;
stale: boolean;
status: QueryStatus;
}

Structure​

QueryState
NameTypeDescription
data
Data | undefined

undefined until the query has loaded, then the selected fields of every row

error
unknown

The last failure, also when a refresh failed and the rows stay

hasNextPage
boolean

Whether a paginated query has another page

isFetching
boolean

Whether a request for the query is in flight

stale
boolean

Whether the rows may be out of date: their subset is stale or its syncs are disconnected

status
QueryStatus

error only when a first load failed and there is nothing to show