Skip to Content

Image

Represents an image, including its metadata, file information, and variant associations.

Type Definition

type Image { id: Int alt: String url: String title: String description: String tags: [String] aiProcessed: Boolean width: Int height: Int aspectRatio: String mimeType: String fileExtension: String fileSize: Int fileName: String orientation: String sortOrder: Int type: String attachedToVariant: Boolean variants: [ProductVariant] }

Fields

FieldTypeDescription
idIntThe unique identifier for the image.
altStringThe alt text for the image, used for accessibility and SEO.
urlStringThe direct URL to the image file.
titleStringThe title of the image, often used as alt text.
descriptionStringThe description of the image, if available.
tags[String]The tags associated with the image.
aiProcessedBooleanIndicates whether the image has been processed by AI.
widthIntThe width of the image in pixels.
heightIntThe height of the image in pixels.
aspectRatioStringThe aspect ratio of the image, such as 16:9.
mimeTypeStringThe MIME type of the image file.
fileExtensionStringThe file extension of the image, such as jpg or png.
fileSizeIntThe size of the image file in bytes.
fileNameStringThe file name of the image.
orientationStringThe orientation of the image, such as landscape or portrait.
sortOrderIntThe sort order of the image among other images.
typeStringThe type of media, which is always ‘image’ for this drop.
attachedToVariantBooleanIndicates whether the image is attached to a product variant. Only available when accessed through product image or media methods.
variants[ProductVariant]The product variants this image is attached to. Only available when accessed through product image or media methods.

Relationships

The Image type is associated with product variants through the variants field, which contains a list of ProductVariant objects that this image is attached to. This relationship is only available when the image is accessed through product image or media methods. The image can be used across various product-related types including ProductBundleContent, ProductOptionValue, and Product.

Example

{ id alt url title description tags aiProcessed width height aspectRatio mimeType fileExtension fileSize fileName orientation sortOrder type attachedToVariant variants { id } }

Implements

None