Skip to content

Braga has been retired. The next public testnet is coming in September 2026. Read the announcement →

Defined in: src/query/queryResult.ts:21

One page of query results.

A page is immutable: next returns the following page rather than mutating this one, so a page that has been read stays readable.

let page = await client.select({ key: true }).where(eq("category", "docs")).limit(100).fetch()
while (page.hasNextPage()) {
page = await page.next()
}

TEntity = Entity

The shape of each entity, inferred from the selection by client.select().

new QueryResult<TEntity>(entities, blockNumber, cursor, fetchPage): QueryResult<TEntity>

Defined in: src/query/queryResult.ts:36

readonly TEntity[]

bigint

string | undefined

FetchPage<TEntity>

QueryResult<TEntity>

readonly blockNumber: bigint

Defined in: src/query/queryResult.ts:30

The block this page was read at.

Every page of one walk reads the same block — the cursor is bound to it — so results cannot shift under a paginating reader.


readonly cursor: string | undefined

Defined in: src/query/queryResult.ts:32

The cursor for the next page, or undefined when this was the last one.


readonly entities: readonly TEntity[]

Defined in: src/query/queryResult.ts:23

The entities on this page.

hasNextPage(): boolean

Defined in: src/query/queryResult.ts:54

Whether another page follows.

The node omits the cursor once nothing remains, so this is an answer rather than the guess a short final page would be — a full last page is reported correctly.

boolean


next(): Promise<QueryResult<TEntity>>

Defined in: src/query/queryResult.ts:67

Fetches the next page.

Promise<QueryResult<TEntity>>

If this was the last page — check hasNextPage first.

If the node rejects the request; kind === "cursor" means the cursor expired and the walk has to start again.