Skip to main content

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 @deprecated
products(
filter: ProductFilterInput
where: ProductWhereInput
sortBy: ProductOrder
before: String
after: String
first: Int
last: Int
): ProductCountableConnection
backgroundImage(size: Int, format: ThumbnailFormatEnum = ORIGINAL): 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
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
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
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
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 deprecated scalar

DEPRECATED

This field will be removed in Saleor 4.0. Use the description field instead.

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.where ● ProductWhereInput input

Filtering options for products.

Added in Saleor 3.14
This API is currently in Feature Preview and can be subject to changes at later point.
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

Retrieve the first n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query.

Collection.products.last ● Int scalar

Retrieve the last n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query.

Collection.backgroundImage ● Image object

Collection.backgroundImage.size ● Int scalar

Desired longest side the image in pixels. Defaults to 4096. Images are never cropped. Pass 0 to retrieve the original size (not recommended).

Collection.backgroundImage.format ● ThumbnailFormatEnum enum

The format of the image. When not provided, format of the original image will be used.

Added in Saleor 3.6

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

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


Was this page helpful?