Represents an image resource.
More...
|
| Image (Dictionary< string, object > dataJSON) |
| Accepts deserialized json data. Will further parse passed in data. More...
|
|
string | altText () |
| A word or phrase to share the nature or contents of an image. More...
|
|
string | id () |
| A unique identifier for the image. More...
|
|
string | originalSrc () |
| The location of the original image as a URL. More...
|
|
string | src () |
| The location of the image as a URL. More...
|
|
string | transformedSrc (string alias=null) |
| The location of the transformed image as a URL. More...
|
|
object | Clone () |
|
|
T | Get< T > (string field, string alias=null) |
|
Dictionary< string, object > | Data |
|
Dictionary< string, object > | DataJSON [get, protected set] |
|
Represents an image resource.
◆ Image()
Shopify.Unity.Image.Image |
( |
Dictionary< string, object > |
dataJSON | ) |
|
|
inline |
Accepts deserialized json data. Will further parse passed in data.
- Parameters
-
dataJSON | Deserialized JSON data for Image |
◆ altText()
string Shopify.Unity.Image.altText |
( |
| ) |
|
|
inline |
A word or phrase to share the nature or contents of an image.
◆ id()
string Shopify.Unity.Image.id |
( |
| ) |
|
|
inline |
A unique identifier for the image.
◆ originalSrc()
string Shopify.Unity.Image.originalSrc |
( |
| ) |
|
|
inline |
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.
◆ src()
string Shopify.Unity.Image.src |
( |
| ) |
|
|
inline |
The location of the image as a URL.
- 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:
{
shop {
productImages(maxWidth: 200, scale: 2) {
edges {
node {
src
}
}
}
}
}
After:
{
shop {
productImages {
edges {
node {
transformedSrc(maxWidth: 200, scale: 2)
}
}
}
}
}
◆ transformedSrc()
string Shopify.Unity.Image.transformedSrc |
( |
string |
alias = null | ) |
|
|
inline |
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.
- Parameters
-
alias | If the original field queried was queried using an alias, then pass the matching string. |
The documentation for this class was generated from the following file:
- Assets/Shopify/Unity/Generated/Image.cs