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
}
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.3This 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
Added in Saleor 3.3keysto control which fields you want to include. The default is to include everything.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.3This 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
Added in Saleor 3.3keysto control which fields you want to include. The default is to include everything.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
DEPRECATEDThis field will be removed in Saleor 4.0. Use the
descriptionfield 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●ProductFilterInputinputFiltering options for products.
Collection.products.where ● ProductWhereInput input
Filtering options for products.
Added in Saleor 3.14This 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●IntscalarDesired 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 enumA language code to return the translation for collection.
Interfaces
Node interface
An object with an ID
ObjectWithMetadata interface
Returned by
collection query
Member of
CollectionCountableEdge object ● MenuItem object ● Product object
Implemented by
_Entity union