Skip to main content
Version: 3.x

Collection

Represents a collection of products.

type Collection implements Node, ObjectWithMetadata {
id: ID!
privateMetadata: [MetadataItem!]!
privateMetafield(key: String!): String
privateMetafields(keys: [String!]): Metadata
metadata: [MetadataItem!]!
metafield(key: String!): String
metafields(keys: [String!]): Metadata
seoTitle: String
seoDescription: String
name: String!
description: JSONString
slug: String!
channel: String
descriptionJson: JSONString
products(
filter: ProductFilterInput
sortBy: ProductOrder
before: String
after: String
first: Int
last: Int
): ProductCountableConnection
backgroundImage(size: Int, format: ThumbnailFormatEnum): Image
translation(languageCode: LanguageCodeEnum!): CollectionTranslation
channelListings: [CollectionChannelListing!]
}

Fields

Collection.id ● ID! non-null scalar

Collection.privateMetadata ● [MetadataItem!]! non-null object

List of private metadata items. Requires staff permissions to access.

Collection.privateMetafield ● String scalar

A single key from private metadata. Requires staff permissions to access.

Tip: Use GraphQL aliases to fetch multiple keys.

Added in Saleor 3.3.

Note: this API is currently in Feature Preview and can be subject to changes at later point.

Collection.privateMetafield.key ● String! non-null scalar

Collection.privateMetafields ● Metadata scalar

Private metadata. Requires staff permissions to access. Use keys to control which fields you want to include. The default is to include everything.

Added in Saleor 3.3.

Note: this API is currently in Feature Preview and can be subject to changes at later point.

Collection.privateMetafields.keys ● [String!] list scalar

Collection.metadata ● [MetadataItem!]! non-null object

List of public metadata items. Can be accessed without permissions.

Collection.metafield ● String scalar

A single key from public metadata.

Tip: Use GraphQL aliases to fetch multiple keys.

Added in Saleor 3.3.

Note: this API is currently in Feature Preview and can be subject to changes at later point.

Collection.metafield.key ● String! non-null scalar

Collection.metafields ● Metadata scalar

Public metadata. Use keys to control which fields you want to include. The default is to include everything.

Added in Saleor 3.3.

Note: this API is currently in Feature Preview and can be subject to changes at later point.

Collection.metafields.keys ● [String!] list scalar

Collection.seoTitle ● String scalar

Collection.seoDescription ● String scalar

Collection.name ● String! non-null scalar

Collection.description ● JSONString scalar

Description of the collection.

Rich text format. For reference see https://editorjs.io/

Collection.slug ● String! non-null scalar

Collection.channel ● String scalar

Channel given to retrieve this collection. Also used by federation gateway to resolve this object in a federated query.

Collection.descriptionJson ● JSONString scalar

Description of the collection.

Rich text format. For reference see https://editorjs.io/

Collection.products ● ProductCountableConnection object

List of products in this collection.

Collection.products.filter ● ProductFilterInput input

Filtering options for products.

Collection.products.sortBy ● ProductOrder input

Sort products.

Collection.products.before ● String scalar

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

Collection.products.after ● String scalar

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

Collection.products.first ● Int scalar

Return the first n elements from the list.

Collection.products.last ● Int scalar

Return the last n elements from the list.

Collection.backgroundImage ● Image object

Collection.backgroundImage.size ● Int scalar

Size of the image. If not provided, the original image will be returned.

Collection.backgroundImage.format ● ThumbnailFormatEnum enum

The format of the image. When not provided, format of the original image will be used. Must be provided together with the size value, otherwise original image will be returned.

Added in Saleor 3.6.

Note: this API is currently in Feature Preview and can be subject to changes at later point.

Collection.translation ● CollectionTranslation object

Returns translated collection fields for the given language code.

Collection.translation.languageCode ● LanguageCodeEnum! non-null enum

A language code to return the translation for collection.

Collection.channelListings ● [CollectionChannelListing!] list object

List of channels in which the collection is available.

Requires one of the following permissions: MANAGE_PRODUCTS.

Interfaces

Node interface

An object with an ID

ObjectWithMetadata interface

Returned by

collection query

Member of

CollectionAddProducts object ● CollectionChannelListingUpdate object ● CollectionCountableEdge object ● CollectionCreate object ● CollectionCreated object ● CollectionDelete object ● CollectionDeleted object ● CollectionMetadataUpdated object ● CollectionRemoveProducts object ● CollectionReorderProducts object ● CollectionTranslatableContent object ● CollectionTranslate object ● CollectionUpdate object ● CollectionUpdated object ● MenuItem object ● Product object

Implemented by

_Entity union