Parameters
Returns
CollectionListBuilder (chainable)
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Paginate forward
openbridge.collections.list().after(cursor)
| Param | Type | Required | Description |
|---|---|---|---|
cursor | string | Yes | pageInfo.endCursor from previous response |
CollectionListBuilder (chainable)
// First page
const page1 = await openbridge.collections.list().limit(10)
// Next page
if (page1.pageInfo.hasNextPage && page1.pageInfo.endCursor) {
const page2 = await openbridge.collections
.list()
.limit(10)
.after(page1.pageInfo.endCursor)
}
const page1 = await openbridge.collections.list().search('sale').limit(10)
if (page1.pageInfo.hasNextPage && page1.pageInfo.endCursor) {
const page2 = await openbridge.collections
.list()
.search('sale')
.limit(10)
.after(page1.pageInfo.endCursor)
}
async function loadAll() {
const all = []
let cursor = null
let hasMore = true
while (hasMore) {
let query = openbridge.collections.list().limit(100)
if (cursor) query = query.after(cursor)
const { items, pageInfo } = await query
all.push(...items)
hasMore = pageInfo.hasNextPage
cursor = pageInfo.endCursor
}
return all
}