Defined in: packages/query-db-collection/src/query.ts:301
Utility methods available on Query Collections for direct writes and manual operations. Direct writes bypass optimistic mutations and write to the synced data store. Direct writes do not trigger a Query refetch. On-demand cache edits are best-effort and do not establish scoped result authority.
The type of errors that can occur during queries
TItem extends object = Record<string, unknown>
The type of items stored in the collection
TKey extends string | number = string | number
The type of the item keys
TInsertInput extends object = TItem
The type accepted for insert operations
_TError = unknown
dataUpdatedAt: number;Defined in: packages/query-db-collection/src/query.ts:334
Get timestamp of last successful data update (in milliseconds)
fetchStatus: "idle" | "fetching" | "paused";Defined in: packages/query-db-collection/src/query.ts:340
Get the aggregate observer fetch status. Returns fetching if any observer is fetching, otherwise paused if any observer is paused, and idle when every observer is idle or no observers exist.
isFetching: boolean;Defined in: packages/query-db-collection/src/query.ts:328
Check if query is currently fetching (initial or background)
isLoading: boolean;Defined in: packages/query-db-collection/src/query.ts:332
Check if query is loading for the first time (no data yet)
isRefetching: boolean;Defined in: packages/query-db-collection/src/query.ts:330
Check if query is refetching in background (not initial fetch)
refetch: RefetchFn;Defined in: packages/query-db-collection/src/query.ts:311
Manually refetch and await the applicable fetch or application boundary.
writeBatch: (callback) => Promise<void>;Defined in: packages/query-db-collection/src/query.ts:323
Execute direct writes as one atomic batch. Resolves when the sync commit applies.
() => void
Promise<void>
writeDelete: (keys) => Promise<void>;Defined in: packages/query-db-collection/src/query.ts:319
Delete items without an optimistic update. Resolves when the sync commit applies.
TKey | TKey[]
Promise<void>
writeInsert: (data) => Promise<void>;Defined in: packages/query-db-collection/src/query.ts:313
Insert items without an optimistic update. Resolves when the sync commit applies.
TInsertInput | TInsertInput[]
Promise<void>
writeUpdate: (updates) => Promise<void>;Defined in: packages/query-db-collection/src/query.ts:315
Update items without an optimistic update. Resolves when the sync commit applies.
Partial<TItem> | Partial<TItem>[]
Promise<void>
writeUpsert: (data) => Promise<void>;Defined in: packages/query-db-collection/src/query.ts:321
Insert or update items without an optimistic update. Resolves when the sync commit applies.
Partial<TItem> | Partial<TItem>[]
Promise<void>