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
The ID of the collection.
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
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.
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
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.
Collection.metafields.keys●[String!]list scalar
Collection.seoTitle ● String scalar
SEO title of the collection.
Collection.seoDescription ● String scalar
SEO description of the collection.
Collection.name ● String! non-null scalar
Name of the collection.
Collection.description ● JSONString scalar
Description of the collection.
Rich text format. For reference see https://editorjs.io/
Collection.slug ● String! non-null scalar
Slug of the collection.
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
Background image of the collection.
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.
Collection.channelListings ● [CollectionChannelListing!] list object
List of channels in which the collection is available.
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