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!]
}
Expand ▼

Fields

Collection.id ● ID! non-null scalar miscellaneous

The ID of the collection.

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

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

Collection.privateMetafield ● String scalar miscellaneous

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

Tip: Use GraphQL aliases to fetch multiple keys.

Added in Saleor 3.3
Collection.privateMetafield.key ● String! non-null scalar miscellaneous

Collection.privateMetafields ● Metadata scalar miscellaneous

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
Collection.privateMetafields.keys ● [String!] list scalar miscellaneous

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

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

Collection.metafield ● String scalar miscellaneous

A single key from public metadata.

Tip: Use GraphQL aliases to fetch multiple keys.

Added in Saleor 3.3
Collection.metafield.key ● String! non-null scalar miscellaneous

Collection.metafields ● Metadata scalar miscellaneous

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

Added in Saleor 3.3
Collection.metafields.keys ● [String!] list scalar miscellaneous

Collection.seoTitle ● String scalar miscellaneous

SEO title of the collection.

Collection.seoDescription ● String scalar miscellaneous

SEO description of the collection.

Collection.name ● String! non-null scalar miscellaneous

Name of the collection.

Collection.description ● JSONString scalar miscellaneous

Description of the collection.

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

Collection.slug ● String! non-null scalar miscellaneous

Slug of the collection.

Collection.channel ● String scalar miscellaneous

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

Collection.descriptionJson ● JSONString deprecated scalar miscellaneous

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 products

List of products in this collection.

Collection.products.filter ● ProductFilterInput input products

Filtering options for products.

Collection.products.where ● ProductWhereInput input products

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 products

Sort products.

Collection.products.before ● String scalar miscellaneous

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

Collection.products.after ● String scalar miscellaneous

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

Collection.products.first ● Int scalar miscellaneous

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 miscellaneous

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 miscellaneous

Background image of the collection.

Collection.backgroundImage.size ● Int scalar miscellaneous

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 miscellaneous

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 products

Returns translated collection fields for the given language code.

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

A language code to return the translation for collection.

Collection.channelListings ● [CollectionChannelListing!] list object products

List of channels in which the collection is available.

Requires MANAGE_PRODUCTSpermission.

Interfaces

Node interface miscellaneous

An object with an ID

ObjectWithMetadata interface miscellaneous

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