We're constantly trying to improve your support experience, and your feedback is extremely valuable to us.

Please take a moment to tell us about your experience today.
Sign up for future Help Center user research studies.

Image

Represents an image resource.

Show definition
"""
Represents an image resource.
"""
type Image {
  """
  A word or phrase to share the nature or contents of an image.
  """
  altText: String
  """
  A unique identifier for the image.
  """
  id: ID
  """
  The location of the original image as a URL.
  If there are any existing transformations in the original source URL, they will remain and not be stripped.
  """
  originalSrc: URL!
  """
  The location of the image as a URL.
  """
  src: URL!
  """
  The location of the transformed image as a URL.
  All transformation arguments are considered "best-effort". If they can be applied to an image, they will be.
  Otherwise any transformations which an image type does not support will be ignored.
  """
  transformedSrc(
    """
    Crops the image according to the specified region.
    """
    crop: CropRegion
    """
    Image height in pixels between 1 and 5760.
    """
    maxHeight: Int
    """
    Image width in pixels between 1 and 5760.
    """
    maxWidth: Int
    """
    Best effort conversion of image into content type (SVG -> PNG, Anything -> JGP, Anything -> WEBP are supported).
    """
    preferredContentType: ImageContentType
    """
    Image size multiplier for high-resolution retina displays. Must be between 1 and 3.
    """
    scale: Int = 1
  ): URL!
}

Fields

altText (String)

A word or phrase to share the nature or contents of an image.

id (ID)

A unique identifier for the image.

originalSrc (URL!)

The location of the original image as a URL.

If there are any existing transformations in the original source URL, they will remain and not be stripped.

transformedSrc (URL!)

The location of the transformed image as a URL.

All transformation arguments are considered "best-effort". If they can be applied to an image, they will be. Otherwise any transformations which an image type does not support will be ignored.

crop ( CropRegion )

Crops the image according to the specified region.

maxHeight ( Int )

Image height in pixels between 1 and 5760.

maxWidth ( Int )

Image width in pixels between 1 and 5760.

preferredContentType ( ImageContentType )

Best effort conversion of image into content type (SVG -> PNG, Anything -> JGP, Anything -> WEBP are supported).

scale ( Int )

Image size multiplier for high-resolution retina displays. Must be between 1 and 3.
Default value: true

Deprecated fields

Show/Hide
src (URL!) deprecated

The location of the image as a URL.

Deprecation warning

Previously an image had a single src field. This could either return the original image location or a URL that contained transformations such as sizing or scale.

These transformations were specified by arguments on the parent field.

Now an image has two distinct URL fields: originalSrc and transformedSrc.

  • originalSrc - the original unmodified image URL
  • transformedSrc - the image URL with the specified transformations included

To migrate to the new fields, image transformations should be moved from the parent field to transformedSrc.

Before:

{
  shop {
    productImages(maxWidth: 200, scale: 2) {
      edges {
        node {
          src
        }
      }
    }
  }
}

After:

{
  shop {
    productImages {
      edges {
        node {
          transformedSrc(maxWidth: 200, scale: 2)
        }
      }
    }
  }
}

Represents an image resource.

Show definition
"""
Represents an image resource.
"""
type Image {
  """
  A word or phrase to share the nature or contents of an image.
  """
  altText: String
  """
  A unique identifier for the image.
  """
  id: ID
  """
  The location of the original image as a URL.
  If there are any existing transformations in the original source URL, they will remain and not be stripped.
  """
  originalSrc: URL!
  """
  The location of the image as a URL.
  """
  src: URL!
  """
  The location of the transformed image as a URL.
  All transformation arguments are considered "best-effort". If they can be applied to an image, they will be.
  Otherwise any transformations which an image type does not support will be ignored.
  """
  transformedSrc(
    """
    Crops the image according to the specified region.
    """
    crop: CropRegion
    """
    Image height in pixels between 1 and 5760.
    """
    maxHeight: Int
    """
    Image width in pixels between 1 and 5760.
    """
    maxWidth: Int
    """
    Best effort conversion of image into content type (SVG -> PNG, Anything -> JGP, Anything -> WEBP are supported).
    """
    preferredContentType: ImageContentType
    """
    Image size multiplier for high-resolution retina displays. Must be between 1 and 3.
    """
    scale: Int = 1
  ): URL!
}

Fields

altText (String)

A word or phrase to share the nature or contents of an image.

id (ID)

A unique identifier for the image.

originalSrc (URL!)

The location of the original image as a URL.

If there are any existing transformations in the original source URL, they will remain and not be stripped.

transformedSrc (URL!)

The location of the transformed image as a URL.

All transformation arguments are considered "best-effort". If they can be applied to an image, they will be. Otherwise any transformations which an image type does not support will be ignored.

crop ( CropRegion )

Crops the image according to the specified region.

maxHeight ( Int )

Image height in pixels between 1 and 5760.

maxWidth ( Int )

Image width in pixels between 1 and 5760.

preferredContentType ( ImageContentType )

Best effort conversion of image into content type (SVG -> PNG, Anything -> JGP, Anything -> WEBP are supported).

scale ( Int )

Image size multiplier for high-resolution retina displays. Must be between 1 and 3.
Default value: true

Deprecated fields

Show/Hide
src (URL!) deprecated

The location of the image as a URL.

Deprecation warning

Previously an image had a single src field. This could either return the original image location or a URL that contained transformations such as sizing or scale.

These transformations were specified by arguments on the parent field.

Now an image has two distinct URL fields: originalSrc and transformedSrc.

  • originalSrc - the original unmodified image URL
  • transformedSrc - the image URL with the specified transformations included

To migrate to the new fields, image transformations should be moved from the parent field to transformedSrc.

Before:

{
  shop {
    productImages(maxWidth: 200, scale: 2) {
      edges {
        node {
          src
        }
      }
    }
  }
}

After:

{
  shop {
    productImages {
      edges {
        node {
          transformedSrc(maxWidth: 200, scale: 2)
        }
      }
    }
  }
}

Sign up for a Partner account to get started.

Sign up