Skip to main content

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": "1612039c2ab305ae13cbb04e",
"mediaUpdateInput": {
"alt": "alt",
"caption": "caption",
"title": "title"
}
}

Response

{
"mediaUpdate": {
"_id": "4468ccfc302f7c2b72b562f6",
"id": 8726400478916,
"created": {
"date": 1743771254037
},
"modified": {
"date": 1743426050129
},
"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

NameTypeDescription
mediaRefID!Reference ID of the media item to update.
mediaUpdateInputMediaUpdateInput!Updated media metadata including title, alt text, and caption.

Returns

Media