Parameters
Returns
ProductListBuilder (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.products.list().after(cursor)
| Param | Type | Required | Description |
|---|---|---|---|
cursor | string | Yes | pageInfo.endCursor from previous response |
ProductListBuilder (chainable)
// First page
const page1 = await openbridge.products.list().limit(12)
// Next page
if (page1.pageInfo.hasNextPage && page1.pageInfo.endCursor) {
const page2 = await openbridge.products
.list()
.limit(12)
.after(page1.pageInfo.endCursor)
}
const page1 = await openbridge.products.list().collection('all').limit(12)
if (page1.pageInfo.hasNextPage && page1.pageInfo.endCursor) {
const page2 = await openbridge.products
.list()
.collection('all')
.limit(12)
.after(page1.pageInfo.endCursor)
}
async function loadAll() {
const all = []
let cursor = null
let hasMore = true
while (hasMore) {
let query = openbridge.products.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
}