Skip to main content

Collection

A Collection is a group of products, what may often be referred to as a "Category Page" of some variety. In reality, a collection is far more flexible and can be used to represent any product grouping, and the collectionType can help differentiate between them.

type Collection {
collectionId: ID!
collectionType: String!
content: CollectionContent
contentItemIds: [ID!]
contentItems: [CollectionContentItem]
createdAt: Date!
demandHqId: ID!
description: String
descriptionOrExcerpt(
numberOfCharacters: Int
): String
featuredProductIds: [ID]
primaryImageUrl: String
primaryImageUrlWithFallback(
height: Int
width: Int
): String
products(
after: String
before: String
first: Int
last: Int
manufacturer: [StringFilterInput]
msrp: [FloatRangeFilterInput]
numberOfTermAggregations: ProductNumberOfTermAggregationsInput
price: [FloatRangeFilterInput]
productIds: [ID]
query: String
slugs: [String]
sortOrder: [ProductSortInput]
standardizedColor: [ProductStandardizedColorFilterInput]
status: DemandEntityStatusFilterInput
storefrontIds: IDFilterInput
tagPrefixes: [StringFilterInput]
tags: [StringFilterInput]
vendor: StringFilterInput
): ProductConnectionWithSearch!
publishedAt: Date
rules: CollectionRules
secondaryImageUrl: String
seoDescription: String
seoTitle: String
slug: String!
status: DemandEntityStatus!
storefrontIds: [ID]
subtitle: String
tags: CollectionTags
taxonomyBranches(
after: String
before: String
first: Int
last: Int
taxonomyTree: String!
): TaxonomyBranchConnection!
tertiaryImageUrl: String
title: String!
updatedAt: Date!
updatedBy: ID!
}

Fields​

Collection.collectionId ● ID! non-null scalar​

Collection.collectionType ● String! non-null scalar​

Any string to declare a category of this collection, can be used to filter collections, limit 128 characters.

Collection.content ● CollectionContent object​

Get the content of the collection.

Collection.contentItemIds ● [ID!] list scalar​

The ContentItemIds of the Content Items that are associated with this collection.

Collection.contentItems ● [CollectionContentItem] list object​

Get the content items of the collection.

Collection.createdAt ● Date! non-null scalar​

Collection.demandHqId ● ID! non-null scalar​

Collection.description ● String scalar​

A short description of the collection, limit 1000 characters.

Collection.descriptionOrExcerpt ● String scalar​

Get the description if it exists, or fallback to the excerpt of content for the collection.

Collection.descriptionOrExcerpt.numberOfCharacters ● Int scalar​

The number of characters to return, defaults to 200.

Collection.featuredProductIds ● [ID] list scalar​

This can be used to pin certain products to the top of a collection when using certain sorts. Max number of products is 20.

Collection.primaryImageUrl ● String scalar​

A primary image url for this collection, can be generated from a Collection ContentItem.

Collection.primaryImageUrlWithFallback ● String scalar​

Returns the primary image URL if exists, otherwise attempts to construct an image url from the first (featured) image of the page. If the primary image URL is a CDN URL, it can be passed width and height properties to return a resized image.

Collection.primaryImageUrlWithFallback.height ● Int scalar​

The height of the image to return in pixels.

Collection.primaryImageUrlWithFallback.width ● Int scalar​

The width of the image to return in pixels.

Collection.products ● ProductConnectionWithSearch! non-null object​

Paginate through products in a collection.

Requires the product/read scope.

Collection.products.after ● String scalar​

Returns the elements in the list that come after the specified cursor.

Collection.products.before ● String scalar​

Returns the elements in the list that come before the specified cursor.

Collection.products.first ● Int scalar​

Returns the first n elements from the list.

Collection.products.last ● Int scalar​

Returns the last n elements from the list.

Collection.products.manufacturer ● [StringFilterInput] list input​

Optionally filter by manufacturer.

Collection.products.msrp ● [FloatRangeFilterInput] list input​

Optionally filter by msrp.

Collection.products.numberOfTermAggregations ● ProductNumberOfTermAggregationsInput input​

The number of results to return for each term aggregation. Defaults to 0 for each.

Collection.products.price ● [FloatRangeFilterInput] list input​

Optionally filter by price.

Collection.products.productIds ● [ID] list scalar​

Filter Products to a set of productIds

Collection.products.query ● String scalar​

Query products for certain terms. Searches several fields, including product.tags, product.title, product.vendor, productLocales.description, productLocales.featureBullets, variant.barcode, variant.mpn, variant.sku

Collection.products.slugs ● [String] list scalar​

Filter Products to a set of slugs

Collection.products.sortOrder ● [ProductSortInput] list input​

Sort Products by a series of fields and directions, defaults to CREATED_AT/ASC.

Collection.products.standardizedColor ● [ProductStandardizedColorFilterInput] list input​

Optionally filter by standardized color.

Collection.products.status ● DemandEntityStatusFilterInput input​

Filter Products using Status.

Collection.products.storefrontIds ● IDFilterInput input​

Optionally filter by storefrontIds.

Collection.products.tagPrefixes ● [StringFilterInput] list input​

Filter Products using Tag Prefixes (starts with).

Collection.products.tags ● [StringFilterInput] list input​

Filter Products using Tags.

Collection.products.vendor ● StringFilterInput input​

Optionally filter by vendor.

Collection.publishedAt ● Date scalar​

ISO format date when the collection was published. Note that ensuing updates with status set to PUBLISHED will republish and re-set this date.

Collection.rules ● CollectionRules object​

A map of rules to determine whether a Product should be part of this Collection.

Collection.secondaryImageUrl ● String scalar​

A secondary image url for this collection, often a logo or related item.

Collection.seoDescription ● String scalar​

Description specific for SEO purposes, limit 170 characters.

Collection.seoTitle ● String scalar​

Title specific for SEO purposes, limit 256 characters.

Collection.slug ● String! non-null scalar​

Slug for the URL for this collection. Limit 128 characters.

Collection.status ● DemandEntityStatus! non-null enum​

The status of the collection, can be DRAFT or PUBLISHED.

Collection.storefrontIds ● [ID] list scalar​

Which storefronts should have access to this collection?

Collection.subtitle ● String scalar​

The subtitle of the collection, limit 256 characters.

Collection.tags ● CollectionTags object​

Get the tags of the collection.

Collection.taxonomyBranches ● TaxonomyBranchConnection! non-null object​

List TaxonomyBranches for a Collection. This is very typically only a single collection unless there is an unusual use case.

Requires the user to have the taxonomyBranch/read permission on the associated DemandHq.

Collection.taxonomyBranches.after ● String scalar​

Returns the elements in the list that come after the specified cursor.

Collection.taxonomyBranches.before ● String scalar​

Returns the elements in the list that come before the specified cursor.

Collection.taxonomyBranches.first ● Int scalar​

Returns the first n elements from the list.

Collection.taxonomyBranches.last ● Int scalar​

Returns the last n elements from the list.

Collection.taxonomyBranches.taxonomyTree ● String! non-null scalar​

Collection.tertiaryImageUrl ● String scalar​

A tertiary image url for this collection, not often used.

Collection.title ● String! non-null scalar​

The title of the collection, limit 256 characters.

Collection.updatedAt ● Date! non-null scalar​

Collection.updatedBy ● ID! non-null scalar​

Returned by​

collection query ● createCollection mutation ● createCollectionImageFromUrl mutation ● updateCollection mutation

Member of​

CollectionConnectionWithSearch object ● CollectionEdge object ● CollectionImageFromFileResponse object ● DemandHq object ● TaxonomyBranch object