Skip to main content
Version: 3.x

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

The unique ID of the product media.

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

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

Added in Saleor 3.12

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
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
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

ProductMedia.metafield ● String scalar

A single key from public metadata.

Tip: Use GraphQL aliases to fetch multiple keys.

Added in Saleor 3.12
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
ProductMedia.metafields.keys ● [String!] list scalar

ProductMedia.sortOrder ● Int scalar

The sort order of the media.

ProductMedia.alt ● String! non-null scalar

The alt text of the media.

ProductMedia.type ● ProductMediaType! non-null enum

The type of the media.

ProductMedia.oembedData ● JSONString! non-null scalar

The oEmbed data of the media.

ProductMedia.url ● String! non-null scalar

The URL of the media.

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?