Skip to main content
shoppy.pages.select(fields)
Specifies which fields to include in the response. Use this to optimize query performance by only requesting needed data.

Parameters

ParamTypeRequiredDescription
fieldsPageField[]YesArray of field names

Returns

PagesQueryBuilder (chainable)

Available Fields

type PageField =
    | 'id'
    | 'handle'
    | 'title'
    | 'body'
    | 'bodySummary'
    | 'createdAt'
    | 'updatedAt'
    | 'onlineStoreUrl'
    | 'seo'

Examples

Select specific fields

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

Minimal data for navigation

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

Full content for page display

const page = await shoppy.pages
    .select(['title', 'body', 'seo'])
    .get('about-us')