Skip to main content
openbridge.collections.list()
openbridge.collections.list().limit(10).select(['title', 'handle'])
Fetches a list of collections. Supports chaining methods to configure the query.

Chainable Methods

MethodDescription
.limit(count)Limit number of results (default: 250)
.after(cursor)Fetch results after cursor (pagination)
.before(cursor)Fetch results before cursor (pagination)
.search(query)Filter by search query
.select(fields)Limit returned fields

Returns

CollectionsResult
{
  items: ShopifyCollection[]
  pageInfo: ShopifyPageInfo
}

Examples

Basic usage

const { items, pageInfo } = await openbridge.collections.list()

With limit

const { items } = await openbridge.collections
    .list()
    .limit(10)

With chained methods

const { items, pageInfo } = await openbridge.collections
    .list()
    .search('summer')
    .limit(10)
    .select(['title', 'handle', 'image'])

Pagination

const page1 = await openbridge.collections.list().limit(10)

if (page1.pageInfo.hasNextPage) {
    const page2 = await openbridge.collections
        .list()
        .limit(10)
        .after(page1.pageInfo.endCursor)
}