collectionCreate Mutation
Description
Creates a new collection with the specified title and optional reference.
mutation collectionCreate($title: String!, $collectionRef: ID) {
collectionCreate(title: $title, collectionRef: $collectionRef) {
_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
{
"title": "title",
"collectionRef": "0307ad07c8355fa6da427690"
}
Response
{
"collectionCreate": {
"_id": "75eec61a7c5208cd564a7668",
"created": 1763821091430,
"createdBy": {
"type": "example",
"name": "example",
"email": "email@example.com",
"ref": "e64d2cc3eb0362be4fe14b27"
},
"id": 5265815071529,
"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": "0c53f99815cff74297c74cff",
"title": "example"
}
]
}
}
Arguments
| Name | Type | Description |
|---|---|---|
title | String! | Title of the new collection (required) |
collectionRef | ID | Optional reference ID for the collection |