Product

A product represents an individual item for sale in a Shopify store. Products are often physical, but they don't have to be. For example, a digital download (such as a movie, music or ebook file) also qualifies as a product, as do services (such as equipment rental, work for hire, customization of another product or an extended warranty).

Show definition
# A product represents an individual item for sale in a Shopify store. Products are often physical, but they don't have to be.
# For example, a digital download (such as a movie, music or ebook file) also
# qualifies as a product, as do services (such as equipment rental, work for hire,
# customization of another product or an extended warranty).
type Product implements Node {
  # Globally unique identifier.
  id: ID!

  # List of collections a product belongs to.
  collections(first: Int, after: String, last: Int, before: String, reverse: Boolean = false): CollectionConnection!

  # The date and time when the product was created.
  createdAt: DateTime!

  # Stripped description of the product, single line with HTML tags removed.
  description(
    # Truncates string after the given length.
    truncateAt: Int
  ): String!

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

  # A human-friendly unique string for the Product automatically generated from its title.
  # They are used by the Liquid templating language to refer to objects.
  handle: String!

  # List of images associated with the product.
  images(
    first: Int
    after: String
    last: Int
    before: String
    reverse: Boolean = false
    sortKey: ProductImageSortKeys = POSITION

    # 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
  ): ImageConnection!

  # The online store URL for the product.
  # A value of `null` indicates that the product is not published to the Online Store sales channel.
  onlineStoreUrl: URL

  # List of custom product options (maximum of 3 per product).
  options(
    # Truncate the array result to this size
    first: Int
  ): [ProductOption!]!

  # A categorization that a product can be tagged with, commonly used for filtering and searching.
  productType: String!

  # The date and time when the product was published to the channel.
  publishedAt: DateTime!

  # A categorization that a product can be tagged with, commonly used for filtering and searching.
  # Each comma-separated tag has a character limit of 255.
  tags: [String!]!

  # The product’s title.
  title: String!

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

  # Find a product’s variant based on its selected options.
  # This is useful for converting a user’s selection of product options into a single matching variant.
  # If there is not a variant for the selected options, `null` will be returned.
  variantBySelectedOptions(selectedOptions: [SelectedOptionInput!]!): ProductVariant

  # List of the product’s variants.
  variants(first: Int, after: String, last: Int, before: String, reverse: Boolean = false, sortKey: ProductVariantSortKeys = POSITION): ProductVariantConnection!

  # The product’s vendor name.
  vendor: String!
}

Implements

Connections

collections   (CollectionConnection!)

List of collections a product belongs to.

Argument Type Default Description
after String
before String
first Int
last Int
reverse Boolean false

images   (ImageConnection!)

List of images associated with the product.

Argument Type Default Description
after String
before String
crop CropRegion

If specified, crop the image keeping the specified region

first Int
last Int
maxHeight Int

Image height in pixels between 1 and 2048

maxWidth Int

Image width in pixels between 1 and 2048

reverse Boolean false
scale Int 1

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

sortKey ProductImageSortKeys POSITION

variants   (ProductVariantConnection!)

List of the product’s variants.

Argument Type Default Description
after String
before String
first Int
last Int
reverse Boolean false
sortKey ProductVariantSortKeys POSITION

Fields

createdAt   (DateTime!)

The date and time when the product was created.

description   (String!)

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

Argument Type Default Description
truncateAt Int

Truncates string after the given length.

descriptionHtml   (HTML!)

The description of the product, complete with HTML formatting.

handle   (String!)

A human-friendly unique string for the Product automatically generated from its title. They are used by the Liquid templating language to refer to objects.

id   (ID!)

Globally unique identifier.

onlineStoreUrl   (URL)

The online store URL for the product. A value of null indicates that the product is not published to the Online Store sales channel.

options   ([ProductOption!]!)

List of custom product options (maximum of 3 per product).

Argument Type Default Description
first Int

Truncate the array result to this size

productType   (String!)

A categorization that a product can be tagged with, commonly used for filtering and searching.

publishedAt   (DateTime!)

The date and time when the product was published to the channel.

tags   ([String!]!)

A categorization that a product can be tagged with, commonly used for filtering and searching. Each comma-separated tag has a character limit of 255.

title   (String!)

The product’s title.

updatedAt   (DateTime!)

The date and time when the product was last modified.

variantBySelectedOptions   (ProductVariant)

Find a product’s variant based on its selected options. This is useful for converting a user’s selection of product options into a single matching variant. If there is not a variant for the selected options, null will be returned.

Argument Type Default Description
selectedOptions required [SelectedOptionInput!]!

vendor   (String!)

The product’s vendor name.