Collection object
Represents a collection of products.
Required access
read_products access scope.
On this page
- Connections
 - Fields
 - Types that return Collection
 - Mutations for Collection
 - Implements
 - Deprecated fields
 - Samples
 
Connections
- metafields (
[MetafieldConnection!](https://shopify.dev/docs/admin-api/graphql/reference/metafields/metafieldconnection))
A paginated list of metafields associated with the resource. 
- privateMetafields (
[PrivateMetafieldConnection!](https://shopify.dev/docs/admin-api/graphql/reference/metafields/privatemetafieldconnection))
List of private metafields. 
- 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_atSee 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 accessread_publicationsaccess scope. This scope is currently available only to private apps installed on Shopify Plus stores. 
- resourcePublicationsV2 (
[ResourcePublicationV2Connection!](https://shopify.dev/docs/admin-api/graphql/reference/products-and-collections/resourcepublicationv2))
The list of resources that are either published or staged to be published to a publication.
Required accessread_publicationsaccess scope. This scope is currently available only to private apps installed on Shopify Plus stores. 
- unpublishedPublications (
[PublicationConnection!](https://shopify.dev/docs/admin-api/graphql/reference/apps/publicationconnection))
The list of publications that the resource is not published to.
Required accessread_publicationsaccess scope. This scope is currently available only to private apps installed on Shopify Plus stores. 
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 accessread_publicationsaccess 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. 
- 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. 
- privateMetafield (
[PrivateMetafield](https://shopify.dev/docs/admin-api/graphql/reference/metafields/privatemetafield))
Returns a private metafield found by namespace and key. 
- 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 accessread_publicationsaccess scope. This scope is currently available only to private apps installed on Shopify Plus stores. 
- 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 accessread_product_listingsaccess 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 accessread_publicationsaccess 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
- collectionAddProducts
Adds products to a collection. - collectionCreate
Creates a collection. - collectionDelete
Deletes a collection. - collectionRemoveProducts
Removes a set of products from a given collection. It can take a long time to run. Instead of returning a collection it returns a job, which should be polled. - collectionReorderProducts
Asynchronously reorders a set of products from a given collection. - collectionUpdate
Updates a 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
Show/Hide
An auto-generated type for paginating through multiple Collections.
On this page
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
- 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)
