openbridge.collections.list().select(fields)
openbridge.collections.get(handle).select(fields)
Limits which fields to include in the response. Use this to optimize performance by reducing payload size.
By default, all fields are returned. Use .select() only when you want to optimize by fetching fewer fields.
Parameters
| Param | Type | Required | Description |
|---|
fields | CollectionField[] | Yes | Fields to include |
Available Fields
| Field | Type |
|---|
id | string |
handle | string |
title | string |
description | string |
descriptionHtml | string |
image | ShopifyImage |
updatedAt | string |
onlineStoreUrl | string |
seo | ShopifySeo |
Returns
CollectionsQueryBuilder (chainable)
Examples
Minimal fields
const { items } = await openbridge.collections
.list()
.select(['id', 'title', 'handle'])
For collection cards
const { items } = await openbridge.collections
.list()
.select(['title', 'handle', 'image'])
For collection page
const collection = await openbridge.collections
.get('summer-sale')
.select(['title', 'descriptionHtml', 'image', 'seo'])
For navigation
const { items } = await openbridge.collections
.list()
.limit(10)
.select(['title', 'handle'])