Collection

Required access

unauthenticated_read_product_listings access scope

A collection represents a grouping of products that a shop owner can create to organize them or make their shops easier to browse.

Show definition
# A collection represents a grouping of products that a shop owner can create to
# organize them or make their shops easier to browse.
type Collection implements Node {
  # Stripped description of the collection, single line with HTML tags removed.
  description(
    # Truncates string after the given length.
    truncateAt: Int
  ): String!

  # The description of the collection, complete with HTML formatting.
  descriptionHtml: HTML!

  # A human-friendly unique string for the collection automatically generated from its title.
  # Limit of 255 characters.
  handle: String!

  # Globally unique identifier.
  id: ID!

  # Image associated with the collection.
  image(
    # Crops the image according to the specified region. This argument is
    # deprecated: Use `crop` on `Image.transformedSrc` instead.
    crop: CropRegion

    # Image height in pixels between 1 and 2048. This argument is deprecated: Use
    # `maxHeight` on `Image.transformedSrc` instead.
    maxHeight: Int

    # Image width in pixels between 1 and 2048. This argument is deprecated: Use `maxWidth` on `Image.transformedSrc` instead.
    maxWidth: Int

    # Image size multiplier for high-resolution retina displays. Must be between 1
    # and 3. This argument is deprecated: Use `scale` on `Image.transformedSrc` instead.
    scale: Int = 1
  ): Image

  # List of products in the collection.
  products(
    # Returns the elements that come after the specified cursor.
    after: String

    # Returns the elements that come before the specified cursor.
    before: String

    # Returns up to the first `n` elements from the list.
    first: Int

    # Returns up to the last `n` elements from the list.
    last: Int

    # Reverse the order of the underlying list.
    reverse: Boolean = false

    # Sort the underlying list by the given key.
    sortKey: ProductCollectionSortKeys = COLLECTION_DEFAULT
  ): ProductConnection!

  # The collection’s name. Limit of 255 characters.
  title: String!

  # The date and time when the collection was last modified.
  updatedAt: DateTime!
}

Implements

Connections

products   (ProductConnection!)

List of products in the collection.

Argument Type Default Description
after

String

Returns the elements that come after the specified cursor.

before

String

Returns the elements that come before the specified cursor.

first

Int

Returns up to the first n elements from the list.

last

Int

Returns up to the last n elements from the list.

reverse

Boolean

false

Reverse the order of the underlying list.

sortKey

ProductCollectionSortKeys

COLLECTION_DEFAULT

Sort the underlying list by the given key.

Fields

description   (String!)

Stripped description of the collection, single line with HTML tags removed.

Argument Type Default Description
truncateAt

Int

Truncates string after the given length.

descriptionHtml   (HTML!)

The description of the collection, complete with HTML formatting.

handle   (String!)

A human-friendly unique string for the collection automatically generated from its title. Limit of 255 characters.

id   (ID!)

Globally unique identifier.

image   (Image)

Image associated with the collection.

Argument Type Default Description
crop

CropRegion

Crops the image according to the specified region. This argument is deprecated: Use crop on Image.transformedSrc instead.

maxHeight

Int

Image height in pixels between 1 and 2048. This argument is deprecated: Use maxHeight on Image.transformedSrc instead.

maxWidth

Int

Image width in pixels between 1 and 2048. This argument is deprecated: Use maxWidth on Image.transformedSrc instead.

scale

Int

1

Image size multiplier for high-resolution retina displays. Must be between 1 and 3. This argument is deprecated: Use scale on Image.transformedSrc instead.

title   (String!)

The collection’s name. Limit of 255 characters.

updatedAt   (DateTime!)

The date and time when the collection was last modified.

Sign up for a Partner account to get started.

Sign up