Skip to main content

ProductMedia

Represents a product media.

type ProductMedia 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
sortOrder: Int
alt: String!
type: ProductMediaType!
oembedData: JSONString!
url(size: Int, format: ThumbnailFormatEnum = ORIGINAL): String!
productId: ID
}

Fields

ProductMedia.id ● ID! non-null scalar

ProductMedia.privateMetadata ● [MetadataItem!]! non-null object

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

Added in Saleor 3.12
This API is currently in Feature Preview and can be subject to changes at later point.

ProductMedia.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.12
This API is currently in Feature Preview and can be subject to changes at later point.
ProductMedia.privateMetafield.key ● String! non-null scalar

ProductMedia.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.12
This API is currently in Feature Preview and can be subject to changes at later point.
ProductMedia.privateMetafields.keys ● [String!] list scalar

ProductMedia.metadata ● [MetadataItem!]! non-null object

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

Added in Saleor 3.12
This API is currently in Feature Preview and can be subject to changes at later point.

ProductMedia.metafield ● String scalar

A single key from public metadata.

Tip: Use GraphQL aliases to fetch multiple keys.

Added in Saleor 3.12
This API is currently in Feature Preview and can be subject to changes at later point.
ProductMedia.metafield.key ● String! non-null scalar

ProductMedia.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.12
This API is currently in Feature Preview and can be subject to changes at later point.
ProductMedia.metafields.keys ● [String!] list scalar

ProductMedia.sortOrder ● Int scalar

ProductMedia.alt ● String! non-null scalar

ProductMedia.type ● ProductMediaType! non-null enum

ProductMedia.oembedData ● JSONString! non-null scalar

ProductMedia.url ● String! non-null scalar

ProductMedia.url.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).

ProductMedia.url.format ● ThumbnailFormatEnum enum

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

Added in Saleor 3.6

ProductMedia.productId ● ID scalar

Product id the media refers to.

Added in Saleor 3.12

Interfaces

Node interface

An object with an ID

ObjectWithMetadata interface

Member of

Product object ● ProductMediaCreate object ● ProductMediaCreated object ● ProductMediaDelete object ● ProductMediaDeleted object ● ProductMediaReorder object ● ProductMediaUpdate object ● ProductMediaUpdated object ● ProductVariant object ● VariantMediaAssign object ● VariantMediaUnassign object

Implemented by

_Entity union


Was this page helpful?