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": "f3c0c96c4c2260df072fa351",
"title": "title",
"sort": {
"key": "key",
"order": 42
},
"viewType": "viewType",
"segments": {},
"bannerRef": "0abfaf03895c54acd6c9e49d",
"bannerFormat": "bannerFormat",
"description": "A description"
}
Response
{
"collectionUpdate": {
"_id": "4b015469ff7d3586c9986507",
"created": 1703390131450,
"createdBy": {
"type": "example",
"name": "example",
"email": "email@example.com",
"ref": "c4da32cf46fe554b2a017040"
},
"id": 3544592947948,
"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": "2e50de7df62789d944a3b7c6",
"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 |