Collection object

Represents a collection of products.

Required access:

read_products access scope.

On this page


Connections

metafields ([MetafieldConnection!](https://shopify.dev/docs/admin-api/graphql/reference/metafields/metafieldconnection))

A paginated list of metafields associated with the resource.

Argument Description
after
(
[String](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01)

)
Returns the elements that come after the specified cursor.
before
(
[String](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01)

)
Returns the elements that come before the specified cursor.
first
(
[Int](https://shopify.dev/docs/admin-api/graphql/reference/scalar#int-2021-01)

)
Returns up to the first n elements from the list.
last
(
[Int](https://shopify.dev/docs/admin-api/graphql/reference/scalar#int-2021-01)

)
Returns up to the last n elements from the list.
namespace
(
[String](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01)

)
Finds all metafields with a specific namespace under the resource.
reverse
(
[Boolean](https://shopify.dev/docs/admin-api/graphql/reference/scalar#boolean-2021-01)

)
Reverse the order of the underlying list.
Default value: false

privateMetafields ([PrivateMetafieldConnection!](https://shopify.dev/docs/admin-api/graphql/reference/metafields/privatemetafieldconnection))

List of private metafields.

Argument Description
after
(
[String](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01)

)
Returns the elements that come after the specified cursor.
before
(
[String](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01)

)
Returns the elements that come before the specified cursor.
first
(
[Int](https://shopify.dev/docs/admin-api/graphql/reference/scalar#int-2021-01)

)
Returns up to the first n elements from the list.
last
(
[Int](https://shopify.dev/docs/admin-api/graphql/reference/scalar#int-2021-01)

)
Returns up to the last n elements from the list.
namespace
(
[String](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01)

)
Filter the private metafields by namespace.
reverse
(
[Boolean](https://shopify.dev/docs/admin-api/graphql/reference/scalar#boolean-2021-01)

)
Reverse the order of the underlying list.
Default value: false

products ([ProductConnection!](https://shopify.dev/docs/admin-api/graphql/reference/products-and-collections/product))

The products that are included in the collection.

Argument Description
after
(
[String](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01)

)
Returns the elements that come after the specified cursor.
before
(
[String](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01)

)
Returns the elements that come before the specified cursor.
first
(
[Int](https://shopify.dev/docs/admin-api/graphql/reference/scalar#int-2021-01)

)
Returns up to the first n elements from the list.
last
(
[Int](https://shopify.dev/docs/admin-api/graphql/reference/scalar#int-2021-01)

)
Returns up to the last n elements from the list.
query
(
[String](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01)

)
This field is only used when the collection is smart. If the collection is custom it returns an error. Supported filter parameters:
+ title
+ product_type
+ vendor
+ gift_card
+ created_at
+ updated_at
See the detailed search syntax.
reverse
(
[Boolean](https://shopify.dev/docs/admin-api/graphql/reference/scalar#boolean-2021-01)

)
Reverse the order of the underlying list.
Default value: false
sortKey
([ProductCollectionSortKeys](https://shopify.dev/docs/admin-api/graphql/reference/products-and-collections/productcollectionsortkeys)
)
Sort the underlying list by the given key.
Default value: COLLECTION_DEFAULT

resourcePublications ([ResourcePublicationConnection!](https://shopify.dev/docs/admin-api/graphql/reference/products-and-collections/resourcepublication))

The list of resources that are published to a publication.

Required access

read_publications access scope. This scope is currently available only to private apps installed on Shopify Plus stores.

Argument Description
after
(
[String](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01)
)
Returns the elements that come after the specified cursor.
before
([String](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01)

)
Returns the elements that come before the specified cursor.
first
(
[Int](https://shopify.dev/docs/admin-api/graphql/reference/scalar#int-2021-01)

)
Returns up to the first n elements from the list.
last
(
[Int](https://shopify.dev/docs/admin-api/graphql/reference/scalar#int-2021-01)

)
Returns up to the last n elements from the list.
onlyPublished
(
[Boolean](https://shopify.dev/docs/admin-api/graphql/reference/scalar#boolean-2021-01)

)
Whether to return only the resources that are currently published. If false, then also returns the resources that are scheduled or staged to be published.
Default value: true
reverse
([Boolean](https://shopify.dev/docs/admin-api/graphql/reference/scalar#boolean-2021-01)

)
Reverse the order of the underlying list.
Default value: false

unpublishedPublications ([PublicationConnection!](https://shopify.dev/docs/admin-api/graphql/reference/apps/publicationconnection))

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

Required access

read_publications access scope. This scope is currently available only to private apps installed on Shopify Plus stores.

Argument Description
after
(
[String](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01)

)
Returns the elements that come after the specified cursor.
before
(
[String](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01)

)
Returns the elements that come before the specified cursor.
first
(
[Int](https://shopify.dev/docs/admin-api/graphql/reference/scalar#int-2021-01)

)
Returns up to the first n elements from the list.
last
(
[Int](https://shopify.dev/docs/admin-api/graphql/reference/scalar#int-2021-01)

)
Returns up to the last n elements from the list.
reverse
(
[Boolean](https://shopify.dev/docs/admin-api/graphql/reference/scalar#boolean-2021-01)

)
Reverse the order of the underlying list.
Default value: false

Fields

availablePublicationCount ([Int!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#int-2021-01))

The number of publications a resource is published to without feedback errors.

Required access

read_publications access scope. This scope is currently available only to private apps installed on Shopify Plus stores.

description ([String!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01))

The stripped description of the collection, in a single line with HTML tags removed.

Argument Description
truncateAt
(
[Int](https://shopify.dev/docs/admin-api/graphql/reference/scalar#int-2021-01)

)
Truncates string after the given length.

descriptionHtml ([HTML!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#html-2021-01))

The description of the collection, complete with HTML formatting.

feedback ([ResourceFeedback](https://shopify.dev/docs/admin-api/graphql/reference/apps/resourcefeedback))

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

handle ([String!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01))

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

hasProduct ([Boolean!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#boolean-2021-01))

Whether the collection includes a product.

Argument Description
id
(
[ID!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#id-2021-01)

) REQUIRED
The ID of the product to check.

id ([ID!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#id-2021-01))

Globally unique identifier.

image ([Image](https://shopify.dev/docs/admin-api/graphql/reference/common-objects/image))

The image associated with the collection.

Argument Description
crop
([CropRegion](https://shopify.dev/docs/admin-api/graphql/reference/common-objects/cropregion)
)
Crops the image according to the specified region. This argument is deprecated: Use crop on Image.transformedSrc instead.
maxHeight
(
[Int](https://shopify.dev/docs/admin-api/graphql/reference/scalar#int-2021-01)

)
Image height in pixels between 1 and 2048. This argument is deprecated: Use maxHeight on Image.transformedSrc instead.
maxWidth
([Int](https://shopify.dev/docs/admin-api/graphql/reference/scalar#int-2021-01)

)
Image width in pixels between 1 and 2048. This argument is deprecated: Use maxWidth on Image.transformedSrc instead.
scale
([Int](https://shopify.dev/docs/admin-api/graphql/reference/scalar#int-2021-01)

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

legacyResourceId ([UnsignedInt64!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#unsignedint64-2021-01))

The ID of the corresponding resource in the REST Admin API.

metafield ([Metafield](https://shopify.dev/docs/admin-api/graphql/reference/metafields/metafield))

The metafield associated with the resource.

Argument Description
key
(
[String!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01)

) REQUIRED
Identifier for the metafield (maximum of 30 characters).
namespace
(
[String!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01)

) REQUIRED
Container for a set of metafields (maximum of 20 characters).

privateMetafield ([PrivateMetafield](https://shopify.dev/docs/admin-api/graphql/reference/metafields/privatemetafield))

Returns a private metafield found by namespace and key.

Argument Description
key
(
[String!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01)

) REQUIRED
The key for the private metafield.
namespace
(
[String!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01)

) REQUIRED
The namespace for the private metafield.

productsCount ([Int!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#int-2021-01))

The number of products included in the collection.

publicationCount ([Int!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#int-2021-01))

The number of publications a resource is published on.

Required access

read_publications access scope. This scope is currently available only to private apps installed on Shopify Plus stores.

Argument Description
onlyPublished
(
[Boolean](https://shopify.dev/docs/admin-api/graphql/reference/scalar#boolean-2021-01)

)
Include only the resource’s publications that are published. If false, then return all the resource’s publications including future publications.
Default value: true

publishedOnCurrentPublication ([Boolean!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#boolean-2021-01))

Check to see whether the resource is published to the calling app’s publication.

Required access

read_product_listings access scope.

publishedOnPublication ([Boolean!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#boolean-2021-01))

Check to see whether the resource is published to a given publication.

Required access

read_publications access scope. This scope is currently available only to private apps installed on Shopify Plus stores.

Argument Description
publicationId
(
[ID!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#id-2021-01)

) REQUIRED
The ID of the publication to check.

ruleSet ([CollectionRuleSet](https://shopify.dev/docs/admin-api/graphql/reference/products-and-collections/collectionruleset))

The rules used to assign products to the collection. This applies only to smart collections.

seo ([SEO!](https://shopify.dev/docs/admin-api/graphql/reference/online-store/seo))

SEO information for the collection.

sortOrder ([CollectionSortOrder!](https://shopify.dev/docs/admin-api/graphql/reference/products-and-collections/collectionsortorder))

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

storefrontId ([StorefrontID!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#storefrontid-2021-01))

The storefront ID of the collection.

templateSuffix ([String](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01))

The theme template used when viewing this collection in a store.

title ([String!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01))

The title of the collection.

translations ([[PublishedTranslation!]!](https://shopify.dev/docs/admin-api/graphql/reference/translations/publishedtranslation))

The translations associated with the resource.

Argument Description
locale
(
[String!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01)

) REQUIRED
Filters translations locale.

updatedAt ([DateTime!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#datetime-2021-01))

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


Types that return Collection

  • [Channel.collections](https://shopify.dev/docs/admin-api/graphql/reference/products-and-collections/channel#collections-2021-01)
  • [CollectionPublication.collection](https://shopify.dev/docs/admin-api/graphql/reference/products-and-collections/collectionpublication#collection-2021-01)
  • [DiscountCollections.collections](https://shopify.dev/docs/admin-api/graphql/reference/discounts-and-marketing/discountcollections#collections-2021-01)
  • [PriceRuleItemEntitlements.collections](https://shopify.dev/docs/admin-api/graphql/reference/discounts-and-marketing/priceruleitementitlements#collections-2021-01)
  • [PriceRuleLineItemPrerequisites.collections](https://shopify.dev/docs/admin-api/graphql/reference/discounts-and-marketing/pricerulelineitemprerequisites#collections-2021-01)
  • [Product.collections](https://shopify.dev/docs/admin-api/graphql/reference/products-and-collections/product#collections-2021-01)
  • [Publication.collections](https://shopify.dev/docs/admin-api/graphql/reference/apps/publication#collections-2021-01)
  • [QueryRoot.collection](https://shopify.dev/docs/admin-api/graphql/reference/common-objects/queryroot#collection-2021-01)
  • [QueryRoot.collectionByHandle](https://shopify.dev/docs/admin-api/graphql/reference/common-objects/queryroot#collectionbyhandle-2021-01)
  • [QueryRoot.collections](https://shopify.dev/docs/admin-api/graphql/reference/common-objects/queryroot#collections-2021-01)

Mutations for Collection


Implements

  • [HasMetafields](https://shopify.dev/docs/admin-api/graphql/reference/metafields/hasmetafields)
  • [HasPublishedTranslations](https://shopify.dev/docs/admin-api/graphql/reference/translations/haspublishedtranslations)
  • [Node](https://shopify.dev/docs/admin-api/graphql/reference/common-objects/node)
  • [Publishable](https://shopify.dev/docs/admin-api/graphql/reference/products-and-collections/publishable)

Deprecated fields

publications ([CollectionPublicationConnection!](https://shopify.dev/docs/admin-api/graphql/reference/products-and-collections/collectionpublication)) DEPRECATED

The channels where the collection is published.

Deprecation warning

Use resourcePublications instead

Required access

read_publications access scope. This scope is currently available only to private apps installed on Shopify Plus stores.

Argument Description
after
(
[String](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01)

)
Returns the elements that come after the specified cursor.
before
(
[String](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01)

)
Returns the elements that come before the specified cursor.
first
(
[Int](https://shopify.dev/docs/admin-api/graphql/reference/scalar#int-2021-01)

)
Returns up to the first n elements from the list.
last
(
[Int](https://shopify.dev/docs/admin-api/graphql/reference/scalar#int-2021-01)

)
Returns up to the last n elements from the list.
onlyPublished
([Boolean](https://shopify.dev/docs/admin-api/graphql/reference/scalar#boolean-2021-01)

)
Whether or not to return only the collection publications that are published.
Default value: true
reverse
(
[Boolean](https://shopify.dev/docs/admin-api/graphql/reference/scalar#boolean-2021-01)

)
Reverse the order of the underlying list.
Default value: false

publishedOnChannel ([Boolean!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#boolean-2021-01)) DEPRECATED

Check to see whether the resource is published to a given channel.

Deprecation warning

Use publishedOnPublication instead

Required access

read_publications access scope. This scope is currently available only to private apps installed on Shopify Plus stores.

Argument Description
channelId
(
[ID!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#id-2021-01)

) REQUIRED
The ID of the channel to check.

publishedOnCurrentChannel ([Boolean!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#boolean-2021-01)) DEPRECATED

Check to see whether the resource is published to the calling app’s channel.

Deprecation warning

Use publishedOnCurrentPublication instead

Required access

read_product_listings access scope.

unpublishedChannels ([ChannelConnection!](https://shopify.dev/docs/admin-api/graphql/reference/products-and-collections/channel)) DEPRECATED

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

Deprecation warning

Use unpublishedPublications instead

Required access

read_publications access scope. This scope is currently available only to private apps installed on Shopify Plus stores.

Argument Description
after
(
[String](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01)

)
Returns the elements that come after the specified cursor.
before
(
[String](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01)

)
Returns the elements that come before the specified cursor.
first
(
[Int](https://shopify.dev/docs/admin-api/graphql/reference/scalar#int-2021-01)

)
Returns up to the first n elements from the list.
last
(
[Int](https://shopify.dev/docs/admin-api/graphql/reference/scalar#int-2021-01)

)
Returns up to the last n elements from the list.
reverse
(
[Boolean](https://shopify.dev/docs/admin-api/graphql/reference/scalar#boolean-2021-01)

)
Reverse the order of the underlying list.
Default value: false

An auto-generated type for paginating through multiple Collections.


On this page

Fields


Fields

edges ([[CollectionEdge!]!](https://shopify.dev/docs/admin-api/graphql/reference/products-and-collections/collection))

A list of edges.

pageInfo ([PageInfo!](https://shopify.dev/docs/admin-api/graphql/reference/pageinfo))

Information to aid in pagination.

An auto-generated type which holds one Collection and a cursor during pagination.


On this page

Fields

Types that return CollectionEdge


Fields

cursor ([String!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01))

A cursor for use in pagination.

node ([Collection!](https://shopify.dev/docs/admin-api/graphql/reference/products-and-collections/collection))

The item at the end of CollectionEdge.


Types that return CollectionEdge

[CollectionConnection.edges](https://shopify.dev/docs/admin-api/graphql/reference/products-and-collections/collection#edges-2021-01)