Assets
For more involved control of your assets, you can navigate to your Asset Library at any time using its button at the top of the navigation sidebar. From here, you can see all assets. Selecting an asset will bring up its edit panel, where you can:
- Change its metadata
- Save it to your device
- View it in your browser
- Replace it with another asset on your device
- Delete the asset entirely.
Assets can be added to a content item's asset field by pressing its Choose button on an empty field or its Replace button on a filled one. Assets can be dragged from the asset library panel that appear to any asset field.
Querying Assets
When querying assets you can include fields to provide transformed URLs.
url
- Provides the base URL of the asset, which is going to be CDN cached.image
- This only applied to image assets. Takes args that allow you to set params adhering to the Imgix Rendering API.imageMeta
- This only applied to image assets. Returns the metadata of the image, such as pixel width and height.
Sample GraphQL query for an field named "photo"
query {
photo {
caption
credit
description
filename
mimeType
path
title
url
imageMeta {
pixelWidth
pixelHeight
}
thumbnail: image(params: { w: 100, h: 100, fit: "crop" }) {
url
}
image {
url
}
}
}