Mutation
mutation UpdateSnippet($input: UpdateSnippetInput!) {
updateSnippet(input: $input) {
snippet {
id
name
text
markdown
path
isDeleted
}
error {
message
type
code
fields {
field
message
type
}
}
}
}Variables
{
"input": {
"snippetId": "id"
}
}Response
{
"data": {
"updateSnippet": {
"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
updateSnippet
Updates one or more fields of an existing snippet. Each field uses a wrapper input — pass { value: "..." } to set it or omit it entirely to leave it unchanged. To remove the snippet’s path (un-group it) pass { value: null }. Requires the snippet:edit permission.
MUTATION
updateSnippet(input: UpdateSnippetInput!): UpdateSnippetOutput!Arguments
input
required
Returns
snippet
error
Mutation
mutation UpdateSnippet($input: UpdateSnippetInput!) {
updateSnippet(input: $input) {
snippet {
id
name
text
markdown
path
isDeleted
}
error {
message
type
code
fields {
field
message
type
}
}
}
}Variables
{
"input": {
"snippetId": "id"
}
}Response
{
"data": {
"updateSnippet": {
"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?

