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

Response

{
"mediaUpdate": {
"_id": "ff34a5615b0e11814196fce7",
"id": 1622929255827,
"created": {
"date": 1744033926563
},
"modified": {
"date": 1712411984475
},
"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