Anchor to commentNotSpamcomment
commentNotSpam
mutation
Requires Any of ,
access scopes.
Marks a comment as not spam.
Anchor to Arguments
Arguments
- •ID!required
The ID of the comment to be marked as not spam.
Was this section helpful?
Anchor to CommentNotSpamPayload returnsCommentNotSpamPayload returns
- Anchor to commentcomment•
The comment that was marked as not spam.
- Anchor to userErrorsuser•
Errors [CommentNot non-nullSpam User Error!]! The list of errors that occurred from executing the mutation.
Was this section helpful?
- Marks a comment as not spam
- commentNotSpam reference
Examples
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
mutation CommentNotSpam($id: ID!) {
commentNotSpam(id: $id) {
comment {
id
}
userErrors {
code
field
message
}
}
}`,
{
variables: {
"id": "gid://shopify/Comment/9450891"
},
},
);
const data = await response.json();
mutation CommentNotSpam($id: ID!) {
commentNotSpam(id: $id) {
comment {
id
}
userErrors {
code
field
message
}
}
}
curl -X POST \
https://your-development-store.myshopify.com/admin/api/2024-10/graphql.json \
-H 'Content-Type: application/json' \
-H 'X-Shopify-Access-Token: {access_token}' \
-d '{
"query": "mutation CommentNotSpam($id: ID!) { commentNotSpam(id: $id) { comment { id } userErrors { code field message } } }",
"variables": {
"id": "gid://shopify/Comment/9450891"
}
}'
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
mutation CommentNotSpam($id: ID!) {
commentNotSpam(id: $id) {
comment {
id
}
userErrors {
code
field
message
}
}
}`,
{
variables: {
"id": "gid://shopify/Comment/9450891"
},
},
);
const data = await response.json();
const client = new shopify.clients.Graphql({session});
const data = await client.query({
data: {
"query": `mutation CommentNotSpam($id: ID!) {
commentNotSpam(id: $id) {
comment {
id
}
userErrors {
code
field
message
}
}
}`,
"variables": {
"id": "gid://shopify/Comment/9450891"
},
},
});
session = ShopifyAPI::Auth::Session.new(
shop: "your-development-store.myshopify.com",
access_token: access_token
)
client = ShopifyAPI::Clients::Graphql::Admin.new(
session: session
)
query = <<~QUERY
mutation CommentNotSpam($id: ID!) {
commentNotSpam(id: $id) {
comment {
id
}
userErrors {
code
field
message
}
}
}
QUERY
variables = {
"id": "gid://shopify/Comment/9450891"
}
response = client.query(query: query, variables: variables)
Input variables
JSON{
"id": "gid://shopify/Comment/9450891"
}
Response
JSON{
"commentNotSpam": {
"comment": {
"id": "gid://shopify/Comment/9450891"
},
"userErrors": []
}
}