openbridge.products.list().select(fields)
openbridge.products.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 | ProductField[] | Yes | Fields to include |
Available Fields
| Field | Type |
|---|
id | string |
handle | string |
title | string |
description | string |
descriptionHtml | string |
availableForSale | boolean |
featuredImage | ShopifyImage |
images | ShopifyImage[] |
priceRange | ShopifyPriceRange |
compareAtPriceRange | ShopifyPriceRange |
options | ShopifyProductOption[] |
variants | ShopifyProductVariant[] |
sellingPlanGroups | ShopifySellingPlanGroup[] |
productType | string |
vendor | string |
tags | string[] |
createdAt | string |
updatedAt | string |
publishedAt | string |
onlineStoreUrl | string |
seo | ShopifySeo |
Returns
ProductsQueryBuilder (chainable)
Examples
Minimal fields
const { items } = await openbridge.products
.list()
.select(['id', 'title', 'handle'])
For product cards
const { items } = await openbridge.products
.list()
.select([
'title',
'handle',
'priceRange',
'featuredImage',
'availableForSale'
])
For product page
const product = await openbridge.products
.get('product-handle')
.select([
'title',
'descriptionHtml',
'images',
'priceRange',
'compareAtPriceRange',
'options',
'variants',
'vendor'
])
For variant selector
const product = await openbridge.products
.get('product-handle')
.select(['options', 'variants'])