public static class Storefront.Image
extends <any>
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getAltText()
A word or phrase to share the nature or contents of an image.
|
java.lang.String |
getGraphQlTypeName() |
java.lang.Integer |
getHeight()
The original height of the image in pixels.
|
ID |
getId()
A unique identifier for the image.
|
java.lang.String |
getOriginalSrc()
The location of the original image as a URL.
|
java.lang.String |
getSrc()
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)
}
}
}
}
}
```
|
java.lang.String |
getTransformedSrc()
The location of the transformed image as a URL.
|
java.lang.Integer |
getWidth()
The original width of the image in pixels.
|
Storefront.Image |
setAltText(java.lang.String arg) |
Storefront.Image |
setHeight(java.lang.Integer arg) |
Storefront.Image |
setId(ID arg) |
Storefront.Image |
setOriginalSrc(java.lang.String arg) |
Storefront.Image |
setSrc(java.lang.String arg) |
Storefront.Image |
setTransformedSrc(java.lang.String arg) |
Storefront.Image |
setWidth(java.lang.Integer arg) |
boolean |
unwrapsToObject(java.lang.String key) |
public Image()
public Image(JsonObject fields)
throws SchemaViolationError
SchemaViolationErrorpublic java.lang.String getGraphQlTypeName()
public java.lang.String getAltText()
public Storefront.Image setAltText(java.lang.String arg)
public java.lang.Integer getHeight()
public Storefront.Image setHeight(java.lang.Integer arg)
public ID getId()
public Storefront.Image setId(ID arg)
public java.lang.String getOriginalSrc()
public Storefront.Image setOriginalSrc(java.lang.String arg)
public java.lang.String getSrc()
public Storefront.Image setSrc(java.lang.String arg)
public java.lang.String getTransformedSrc()
public Storefront.Image setTransformedSrc(java.lang.String arg)
public java.lang.Integer getWidth()
public Storefront.Image setWidth(java.lang.Integer arg)
public boolean unwrapsToObject(java.lang.String key)