Skip to main content

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": "a004c9e6391056127bdcb595"
}

Response

{
"collectionCreate": {
"_id": "b56c55b74cf52365ebda50ad",
"created": 1765202579071,
"createdBy": {
"type": "example",
"name": "example",
"email": "email@example.com",
"ref": "40669ff7d18f096bc797f36f"
},
"id": 4631978758155,
"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": "b3b74a9caca0074b31b04d39",
"title": "example"
}
]
}
}

Arguments

NameTypeDescription
titleString!Title of the new collection (required)
collectionRefIDOptional reference ID for the collection

Returns

Collection!