Media and images
Read Asset file metadata and request nullable original or named image-service URLs in GraphQL.
GraphQL Asset fields expose file metadata and nullable image-service URLs. A non-image or absent file may not have a URL.
Access
Use a Backend-scoped delivery permission. Preview sessions apply live authorization to the containing and Asset Data Types. Reading a configured image style does not require the management permissions imagePreset.read, imagePreset.create, imagePreset.update, or imagePreset.delete.
Query an Asset
query GetHero($id: ID!) {
article(id: $id) {
hero {
_id
file {
url
card: transformUrl(preset: "card")
mimeType
extension
originalName
size
metadata {
... on AssetImageMetadata {
width
height
orientation
}
}
}
}
}
}
Handle both URL fields as nullable:
{
"data": {
"article": {
"hero": {
"_id": "ASSET_ID",
"file": {
"url": "https://images.example.com/ORIGINAL_PATH",
"card": "https://images.example.com/CARD_PATH",
"mimeType": "image/jpeg",
"extension": "jpg",
"originalName": "hero.jpg",
"size": 245760,
"metadata": { "width": 1600, "height": 900, "orientation": 1 }
}
}
}
}
}
Both url and transformUrl(preset:) are produced through the configured image service. Named presets only are supported; there is no public arbitrary-transform contract. When both focal coordinates exist, image generation applies them.
REST Asset relations remain IDs and do not expand file metadata or URLs. Exact behavior for an unknown preset is not a documented contract, so treat a null or GraphQL error as unavailable rather than branching on message text.