public static class Storefront.ImageQuery
extends <any>
| Modifier and Type | Class and Description |
|---|---|
class |
Storefront.ImageQuery.TransformedSrcArguments |
static interface |
Storefront.ImageQuery.TransformedSrcArgumentsDefinition |
| Modifier and Type | Method and Description |
|---|---|
Storefront.ImageQuery |
altText()
A word or phrase to share the nature or contents of an image.
|
Storefront.ImageQuery |
height()
The original height of the image in pixels.
|
Storefront.ImageQuery |
id()
A unique identifier for the image.
|
Storefront.ImageQuery |
originalSrc()
The location of the original image as a URL.
|
Storefront.ImageQuery |
src()
Deprecated.
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:
```graphql
{
shop {
productImages(maxWidth: 200, scale: 2) {
edges {
node {
src
}
}
}
}
}
```
After:
```graphql
{
shop {
productImages {
edges {
node {
transformedSrc(maxWidth: 200, scale: 2)
}
}
}
}
}
```
|
Storefront.ImageQuery |
transformedSrc()
The location of the transformed image as a URL.
|
Storefront.ImageQuery |
transformedSrc(Storefront.ImageQuery.TransformedSrcArgumentsDefinition argsDef)
The location of the transformed image as a URL.
|
Storefront.ImageQuery |
width()
The original width of the image in pixels.
|
public Storefront.ImageQuery altText()
public Storefront.ImageQuery height()
public Storefront.ImageQuery id()
public Storefront.ImageQuery originalSrc()
@Deprecated public Storefront.ImageQuery src()
public Storefront.ImageQuery transformedSrc()
public Storefront.ImageQuery transformedSrc(Storefront.ImageQuery.TransformedSrcArgumentsDefinition argsDef)
public Storefront.ImageQuery width()