mediaUpdate Mutation
Description
Updates metadata for a media item, including title, alt text, and caption.
mutation mediaUpdate($mediaRef: ID!, $mediaUpdateInput: MediaUpdateInput!) {
mediaUpdate(mediaRef: $mediaRef, mediaUpdateInput: $mediaUpdateInput) {
_id
id
created {
date
}
modified {
date
}
title
alt
caption
ext
mime
size
width
height
url
key
formatArray {
name
ext
mime
width
height
size
url
key
}
folder
}
}
Variables
{
"mediaRef": "08cdefff8da08064213da333",
"mediaUpdateInput": {
"alt": "alt",
"caption": "caption",
"title": "title"
}
}
Response
{
"mediaUpdate": {
"_id": "236ce1fad0febb2b6d87ba3b",
"id": 2129324310448,
"created": {
"date": 1718115912103
},
"modified": {
"date": 1733629993750
},
"title": "example",
"alt": "example",
"caption": "example",
"ext": "example",
"mime": "example",
"size": 42,
"width": 42,
"height": 42,
"url": "https://example.com",
"key": "example",
"formatArray": [
{
"name": "example",
"ext": "example",
"mime": "example",
"width": 42,
"height": 42,
"size": 42,
"url": "https://example.com",
"key": "example"
}
],
"folder": "example"
}
}
Arguments
| Name | Type | Description |
|---|---|---|
mediaRef | ID! | Reference ID of the media item to update. |
mediaUpdateInput | MediaUpdateInput! | Updated media metadata including title, alt text, and caption. |