Collection

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 {
  id: ID!

  # 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!

  # Stripped description of the collection, single line with HTML tags removed.
  # Truncated to 60 characters.
  descriptionPlainSummary: String!

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

  # Image associated with the collection.
  image(
    # Image width in pixels between 1 and 2048
    maxWidth: Int

    # Image height in pixels between 1 and 2048
    maxHeight: Int

    # If specified, crop the image keeping the specified region
    crop: CropRegion

    # Image size multiplier retina displays. Must be between 1 and 3
    scale: Int = 1
  ): Image

  # List of products in the collection.
  products(first: Int!, after: String, reverse: Boolean = false): 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
first required Int
reverse Boolean false

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.

descriptionPlainSummary   (String!) deprecated

Stripped description of the collection, single line with HTML tags removed. Truncated to 60 characters.

Use description instead

handle   (String!)

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

id   (ID!)

image   (Image)

Image associated with the collection.

Argument Type Default Description
crop CropRegion

If specified, crop the image keeping the specified region

maxHeight Int

Image height in pixels between 1 and 2048

maxWidth Int

Image width in pixels between 1 and 2048

scale Int 1

Image size multiplier retina displays. Must be between 1 and 3

title   (String!)

The collection’s name. Limit of 255 characters.

updatedAt   (DateTime!)

The date and time when the collection was last modified.