Skip to main content

ProductMedia Object

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
}
Expand ▼

Fields

ProductMedia.id ● ID! non-null scalar miscellaneous

The unique ID of the product media.

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

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

ProductMedia.privateMetafield ● String scalar miscellaneous

A single key from private metadata. Requires staff permissions to access.

Tip: Use GraphQL aliases to fetch multiple keys.

ProductMedia.privateMetafield.key ● String! non-null scalar miscellaneous

ProductMedia.privateMetafields ● Metadata scalar miscellaneous

Private metadata. Requires staff permissions to access. Use keys to control which fields you want to include. The default is to include everything.

ProductMedia.privateMetafields.keys ● [String!] list scalar miscellaneous

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

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

ProductMedia.metafield ● String scalar miscellaneous

A single key from public metadata.

Tip: Use GraphQL aliases to fetch multiple keys.

ProductMedia.metafield.key ● String! non-null scalar miscellaneous

ProductMedia.metafields ● Metadata scalar miscellaneous

Public metadata. Use keys to control which fields you want to include. The default is to include everything.

ProductMedia.metafields.keys ● [String!] list scalar miscellaneous

ProductMedia.sortOrder ● Int scalar miscellaneous

The sort order of the media.

ProductMedia.alt ● String! non-null scalar miscellaneous

The alt text of the media.

ProductMedia.type ● ProductMediaType! non-null enum products

The type of the media.

ProductMedia.oembedData ● JSONString! non-null scalar miscellaneous

The oEmbed data of the media.

ProductMedia.url ● String! non-null scalar miscellaneous

The URL of the media.

ProductMedia.url.size ● Int scalar miscellaneous

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 miscellaneous

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

ProductMedia.productId ● ID scalar miscellaneous

Product id the media refers to.

Interfaces

Node interface miscellaneous

An object with an ID

ObjectWithMetadata interface miscellaneous

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