Collection

Required access

read_products access scope

Show definition
type Collection implements Node, Publishable {
  # Globally unique identifier.
  id: ID!

  # The number of channels a resource is published on without feedback errors.
  availablePublicationCount: Int!

  # The number of channels a resource is published on.
  publicationCount(
    # Include only the resource's publications that are published. If false it
    # will return all resource's publications including future publications.
    onlyPublished: Boolean = true
  ): Int!

  # The list of resources that are published to a channel.
  publicationsV2(
    # Return only the resources that are published. If false it will return all resource's publications.
    onlyPublished: Boolean = true

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

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

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

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

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

  # Check to see if resource is published to a given channel.
  publishedOnChannel(
    # The ID of the channel to check.
    channelId: ID!
  ): Boolean!

  # Check to see if resource is published to the calling app's channel.
  publishedOnCurrentChannel: Boolean!

  # The list of channels that the resource is not published to.
  unpublishedChannels(
    # Returns up to the first `n` elements from the list.
    first: Int

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

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

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

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

  # The stripped description of the collection, in a 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!

  # Information about the collection that's provided through resource feedback.
  feedback: ResourceFeedback

  # A unique human-friendly string for the collection. Automatically generated from the collection's title.
  handle: String!

  # Whether the collection includes a product.
  hasProduct(
    # The ID of the product to check.
    id: ID!
  ): Boolean!

  # The image associated with the collection.
  image(
    # Image width in pixels between 1 and 2048. This argument is deprecated: Use `maxWidth` on `Image.transformedSrc` instead.
    maxWidth: Int

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

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

    # 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

  # The products that are included in the collection.
  products(
    # Returns up to the first `n` elements from the list.
    first: Int

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

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

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

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

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

  # The number of products included in the collection.
  productsCount: Int!

  # The channels where the collection is published.
  publications(
    # Whether or not to return only the collection publications that are published.
    onlyPublished: Boolean = true

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

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

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

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

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

  # The rules used to assign products to the collection. This applies only to
  # smart collections (indicated by `collection.type`).
  ruleSet: CollectionRuleSet

  # SEO information for the collection.
  seo: SEO!

  # The order in which the collection's products are sorted.
  sortOrder: CollectionSortOrder!

  # The storefront ID of the collection.
  storefrontId: StorefrontID!

  # The title of the collection.
  title: String!

  # The date and time ([ISO 8601 format](http://en.wikipedia.org/wiki/ISO_8601)) when the collection was last modified.
  updatedAt: DateTime!
}

Implements

Connections

products   (ProductConnection!)

The products that are included 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.

publicationsV2   (PublicationConnection!)

The list of resources that are published to a channel.

Required access

read_channels access scope

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.

onlyPublished Boolean true

Return only the resources that are published. If false it will return all resource's publications.

reverse Boolean false

Reverse the order of the underlying list.

unpublishedChannels   (ChannelConnection!)

The list of channels that the resource is not published to.

Required access

read_channels access scope

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.

Fields

availablePublicationCount   (Int!)

The number of channels a resource is published on without feedback errors.

Required access

read_channels access scope

description   (String!)

The stripped description of the collection, in a 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.

feedback   (ResourceFeedback)

Information about the collection that's provided through resource feedback.

handle   (String!)

A unique human-friendly string for the collection. Automatically generated from the collection's title.

hasProduct   (Boolean!)

Whether the collection includes a product.

Argument Type Default Description
id required ID!

The ID of the product to check.

id   (ID!)

Globally unique identifier.

image   (Image)

The 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.

productsCount   (Int!)

The number of products included in the collection.

publicationCount   (Int!)

The number of channels a resource is published on.

Required access

read_channels access scope

Argument Type Default Description
onlyPublished Boolean true

Include only the resource's publications that are published. If false it will return all resource's publications including future publications.

publishedOnChannel   (Boolean!)

Check to see if resource is published to a given channel.

Required access

read_channels access scope

Argument Type Default Description
channelId required ID!

The ID of the channel to check.

publishedOnCurrentChannel   (Boolean!)

Check to see if resource is published to the calling app's channel.

Required access

read_product_listings access scope

ruleSet   (CollectionRuleSet)

The rules used to assign products to the collection. This applies only to smart collections (indicated by collection.type).

seo   (SEO!)

SEO information for the collection.

sortOrder   (CollectionSortOrder!)

The order in which the collection's products are sorted.

storefrontId   (StorefrontID!)

The storefront ID of the collection.

title   (String!)

The title of the collection.

updatedAt   (DateTime!)

The date and time (ISO 8601 format) when the collection was last modified.

Deprecated fields

Show/Hide

publications   (CollectionPublicationConnection!) deprecated

The channels where the collection is published.

Deprecation warning

Use publicationsV2 instead

Required access

read_channels access scope

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.

onlyPublished Boolean true

Whether or not to return only the collection publications that are published.

reverse Boolean false

Reverse the order of the underlying list.