Mutation
mutation CreateSnippet($input: CreateSnippetInput!) {
createSnippet(input: $input) {
snippet {
id
name
text
markdown
path
isDeleted
}
error {
message
type
code
fields {
field
message
type
}
}
}
}Variables
{
"input": {
"name": "string",
"text": "string"
}
}Response
{
"data": {
"createSnippet": {
"snippet": {
"id": "id",
"name": "string",
"text": "string",
"markdown": "string",
"path": "string",
"isDeleted": true
},
"error": {
"message": "string",
"type": "VALIDATION",
"code": "string",
"fields": [
{
"field": "string",
"message": "string",
"type": "VALIDATION"
}
]
}
}
}
}Mutations
createSnippet
Creates a new snippet in the workspace. The name is used to search for the snippet when composing a reply. Provide markdown in addition to text to supply a rich-text version used in channels that support markdown. The optional path (alphanumeric only) places the snippet in a folder in the Plain app. Requires the snippet:create permission.
MUTATION
createSnippet(input: CreateSnippetInput!): CreateSnippetOutput!Arguments
input
required
Returns
snippet
error
Mutation
mutation CreateSnippet($input: CreateSnippetInput!) {
createSnippet(input: $input) {
snippet {
id
name
text
markdown
path
isDeleted
}
error {
message
type
code
fields {
field
message
type
}
}
}
}Variables
{
"input": {
"name": "string",
"text": "string"
}
}Response
{
"data": {
"createSnippet": {
"snippet": {
"id": "id",
"name": "string",
"text": "string",
"markdown": "string",
"path": "string",
"isDeleted": true
},
"error": {
"message": "string",
"type": "VALIDATION",
"code": "string",
"fields": [
{
"field": "string",
"message": "string",
"type": "VALIDATION"
}
]
}
}
}
}Was this page helpful?

