Skip to main content
shoppy.products.select(fields)
Specifies which fields to include in the response. Reduces payload size.
This is a chainable method. Call .list() or .get() to execute.

Parameters

ParamTypeRequiredDescription
fieldsProductField[]YesFields to include

Available Fields

FieldType
idstring
handlestring
titlestring
descriptionstring
descriptionHtmlstring
availableForSaleboolean
featuredImageShopifyImage
imagesShopifyImage[]
priceRangeShopifyPriceRange
compareAtPriceRangeShopifyPriceRange
optionsShopifyProductOption[]
variantsShopifyProductVariant[]
productTypestring
vendorstring
tagsstring[]
createdAtstring
updatedAtstring
publishedAtstring
onlineStoreUrlstring
seoShopifySeo

Returns

ProductsQueryBuilder (chainable)

Examples

Minimal fields

const { items } = await shoppy.products
    .select(['id', 'title', 'handle'])
    .list()

For product cards

const { items } = await shoppy.products
    .select([
        'title',
        'handle',
        'priceRange',
        'featuredImage',
        'availableForSale'
    ])
    .list()

For product page

const product = await shoppy.products
    .select([
        'title',
        'descriptionHtml',
        'images',
        'priceRange',
        'compareAtPriceRange',
        'options',
        'variants',
        'vendor'
    ])
    .get('product-handle')

For variant selector

const product = await shoppy.products
    .select(['options', 'variants'])
    .get('product-handle')
If .select() is not called, default fields are returned.