messageCreate Mutation
Description
Creates a new message associated with an order. Optionally includes file attachments. For non-Discogs orders, attachments are uploaded to cloud storage and email notifications are sent to the buyer. For Discogs orders, messages are sent through the Discogs API.
mutation messageCreate($orderRef: ID!, $message: String!, $files: [Upload]) {
messageCreate(orderRef: $orderRef, message: $message, files: $files) {
_id
created
sender {
name
alias
email
ref
}
subject
message
fromBuyer
flagged
content
attachments {
_id
uri
title
}
read
orderId
orderIncId
uri
via
}
}
Variables
{
"orderRef": "18dd2862e3b3154827dd34eb",
"message": "message",
"files": [
"File"
]
}
Response
{
"messageCreate": {
"_id": "6d699dbc893053dbfe21f4d3",
"created": 1756379581698,
"sender": {
"name": "example",
"alias": "example",
"email": "email@example.com",
"ref": "d6bd4f59df84831fcc9d5836"
},
"subject": "example",
"message": "example",
"fromBuyer": true,
"flagged": true,
"content": "example",
"attachments": [
{
"_id": "d244069cefc90653be831438",
"uri": "https://www.my-common-ground-store.com/release/1763553751/release-artist-release-name",
"title": "example"
}
],
"read": true,
"orderId": "example",
"orderIncId": 42,
"uri": "https://www.my-common-ground-store.com/release/1763553751/release-artist-release-name",
"via": "example"
}
}
Arguments
| Name | Type | Description |
|---|---|---|
orderRef | ID! | Reference ID of the order to associate the message with. |
message | String! | Message content text. |
files | [Upload] | Optional list of files to attach to the message. Files are uploaded to cloud storage and included in email notifications. |