Skip to main content
shoppy.collections.list()
Executes the query and returns a list of collections with pagination info.

Parameters

None

Returns

CollectionsResult
{
  items: ShopifyCollection[]
  pageInfo: {
    hasNextPage: boolean
    hasPreviousPage: boolean
    startCursor: string
    endCursor: string
  }
}

Examples

Basic usage

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

With chained methods

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

Check for more pages

const { items, pageInfo } = await shoppy.collections.limit(10).list()

if (pageInfo.hasNextPage) {
    // More collections available
}