collection Query
Look up a collection by ID, slug or external reference. If slugLanguageCode is provided, category will be fetched by slug translation.
collection(id: ID, slug: String, slugLanguageCode: LanguageCodeEnum, externalReference: String, channel: String): Collection
Returns
Show return type
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
fullDescription: JSONString
slug: String!
externalReference: String
channel: String
descriptionJson: JSONString @deprecated(reason: "Use the `description` field instead.")
products(filter: ProductFilterInput @deprecated(reason: "Use `where` filter instead."), where: ProductWhereInput, search: String, sortBy: ProductOrder, before: String, after: String, first: Int, last: Int): ProductCountableConnection
backgroundImage(size: Int, sizeRounding: ThumbnailSizeRoundingEnum = NEAREST, format: ThumbnailFormatEnum = ORIGINAL): Image
translation(languageCode: LanguageCodeEnum!): CollectionTranslation
channelListings: [CollectionChannelListing!]
}Arguments
id
id · ID
ID of the collection.
slug
slug · String
Slug of the collection
slugLanguageCode
slugLanguageCode · LanguageCodeEnum
Language code of the collection slug, omit to use primary slug.
Added in Saleor 3.21externalReference
externalReference · String
External ID of the collection.
Added in Saleor 3.23channel
channel · String
Slug of a channel for which the data should be returned.
Schema: Saleor 3.23.43. Download SDL.