collectionUpdate Mutation
Description
Updates an existing collection's details, including title, sorting, view type, segments, banner, and description.
mutation collectionUpdate(
$ref: ID!
$title: String!
$sort: CollectionSortInput
$viewType: String
$segments: JSON!
$bannerRef: ID
$bannerFormat: String
$description: String
) {
collectionUpdate(
ref: $ref
title: $title
sort: $sort
viewType: $viewType
segments: $segments
bannerRef: $bannerRef
bannerFormat: $bannerFormat
description: $description
) {
_id
created
createdBy {
type
name
email
ref
}
id
title
description {
content
}
handle
sort {
key
order
}
viewType
seo {
index
description
slug
title
}
path
banner {
format
}
segments {
_id
title
}
}
}
Variables
{
"ref": "e684d1ad5be9d7bde3fe61de",
"title": "title",
"sort": {
"key": "key",
"order": 42
},
"viewType": "viewType",
"segments": {},
"bannerRef": "3afae1f2bfffb0b84b8fae80",
"bannerFormat": "bannerFormat",
"description": "A description"
}
Response
{
"collectionUpdate": {
"_id": "56c3185a6ab569f193b6404a",
"created": 1744519279754,
"createdBy": {
"type": "example",
"name": "example",
"email": "email@example.com",
"ref": "52e57725e9b49d13e280dff1"
},
"id": 2499189195824,
"title": "example",
"description": {
"content": "example"
},
"handle": "example",
"sort": {
"key": "example",
"order": 42
},
"viewType": "example",
"seo": {
"index": true,
"description": "example",
"slug": "example",
"title": "example"
},
"path": "/release/1763553751/release-artist-release-name",
"banner": {
"format": "example"
},
"segments": [
{
"_id": "e3eee01fc3b29a1560638009",
"title": "example"
}
]
}
}
Arguments
| Name | Type | Description |
|---|---|---|
ref | ID! | Reference ID of the collection to update (required) |
title | String! | New title for the collection (required) |
sort | CollectionSortInput | Sorting options for the collection |
viewType | String | Type of view for displaying the collection |
segments | JSON! | JSON object specifying collection segments (required) |
bannerRef | ID | Reference ID for the collection banner |
bannerFormat | String | Format of the banner image |
description | String | Description of the collection |