Comment
Requires access scope or access scope.
A comment on an article.
Anchor to FieldsFields
- Anchor to articlearticle•Article
The article associated with the comment.
- •Comment
Author! non-null The comment’s author.
- Anchor to bodybody•String!non-null
The content of the comment.
- Anchor to bodyHtmlbody•HTML!
Html non-null The content of the comment, complete with HTML formatting.
- Anchor to createdAtcreated•Date
At Time! non-null The date and time when the comment was created.
- Anchor to eventsevents•Event
Connection! non-null The paginated list of events associated with the host subject.
- Anchor to firstfirst•Int
The first
nelements from the paginated list.- Anchor to afterafter•String
The elements that come after the specified cursor.
- Anchor to lastlast•Int
The last
nelements from the paginated list.- Anchor to beforebefore•String
The elements that come before the specified cursor.
- Anchor to reversereverse•BooleanDefault:false
Reverse the order of the underlying list.
- Anchor to sortKeysort•Event
Key Sort Keys Default:ID Sort the underlying list using a key. If your query is slow or returns an error, then try specifying a sort key that matches the field used in the search.
- Anchor to queryquery•String
A filter made up of terms, connectives, modifiers, and comparators. You can apply one or more filters to a query. Learn more about Shopify API search syntax.
- Anchor to comments•boolean
Whether or not to include comment-events in your search, passing
falsewill exclude comment-events, any other value will include comment-events.falsetrue- Anchor to created_at•time
Filter by the date and time when the event happened.
created_at:>2020-10-21created_at:<now- Anchor to subject_type•string
The resource type affected by this event. See EventSubjectType for possible values.
PRODUCT_VARIANTPRODUCTCOLLECTION
Example:
Example:
Example:
Arguments
- •ID!non-null
A globally-unique ID.
- •String
The IP address of the commenter.
- Anchor to isPublishedis•Boolean!
Published non-null Whether or not the comment is published.
- Anchor to publishedAtpublished•Date
At Time The date and time when the comment was published.
- Anchor to statusstatus•Comment
Status! non-null The status of the comment.
- Anchor to updatedAtupdated•Date
At Time The date and time when the comment was last updated.
- Anchor to userAgentuser•String
Agent The user agent of the commenter.
Anchor to QueriesQueries
- •query
Returns a
Commentresource by ID.- •ID!required
The ID of the
Commentto return.
Arguments
- •ID!
- •query
List of the shop's comments.
- Anchor to firstfirst•Int
The first
nelements from the paginated list.- Anchor to afterafter•String
The elements that come after the specified cursor.
- Anchor to lastlast•Int
The last
nelements from the paginated list.- Anchor to beforebefore•String
The elements that come before the specified cursor.
- Anchor to reversereverse•BooleanDefault:false
Reverse the order of the underlying list.
- Anchor to sortKeysort•Comment
Key Sort Keys Default:ID Sort the underlying list using a key. If your query is slow or returns an error, then try specifying a sort key that matches the field used in the search.
- Anchor to queryquery•String
A filter made up of terms, connectives, modifiers, and comparators. You can apply one or more filters to a query. Learn more about Shopify API search syntax.
- Anchor to default•string
Filter by a case-insensitive search of multiple fields in a document.
query=Bob Normanquery=title:green hoodie- Anchor to created_at•time
Filter by the date and time when the comment was created.
created_at:>'2020-10-21T23:39:20Z'created_at:<nowcreated_at:<=2024- Anchor to published_at•time
Filter by the date and time when the comment was published.
published_at:>'2020-10-21T23:39:20Z'published_at:<nowpublished_at:<=2024- Anchor to published_status•string
Filter by published status
anypublishedunpublishedpublished_status:anypublished_status:publishedpublished_status:unpublished- Anchor to status•string
- Anchor to updated_at•time
Filter by the date and time when the comment was last updated.
updated_at:>'2020-10-21T23:39:20Z'updated_at:<nowupdated_at:<=2024
Example:
Example:
Example:
Valid values:
Example:
Example:
Arguments
Anchor to MutationsMutations
- •mutation
Approves a pending comment, making it visible to store visitors on the associated blog article.
For example, when a customer submits a question about a product in a blog post, merchants can approve the comment to make it publicly visible.
Use the
mutation to:- Publish pending comments after review
- Enable customer discussions on blog articles
- Maintain quality control over comments
Once approved, the comment becomes visible to all store visitors.
- •ID!required
The ID of the comment to be approved.
Arguments
- •mutation
Reverses a spam classification on a comment, restoring it to normal moderation status. This mutation allows merchants to change their decision when a comment has been manually marked as spam.
For example, when a merchant reviews comments marked as spam and finds a legitimate customer question, they can use this mutation to restore the comment's normal status and make it eligible for approval.
Use the
mutation to:- Unmark comments that were marked as spam
- Restore comments to normal moderation status
- Move comments back to the approval queue
This action changes the comment's status from spam back to pending, where it can then be approved or managed according to standard moderation practices.
- •ID!required
The ID of the comment to be marked as not spam.
Arguments
- •mutation
Marks a comment as spam, removing it from public view. This mutation enables merchants to quickly handle unwanted promotional content, malicious links, or other spam that appears in blog discussions.
For example, when a comment contains suspicious links to unrelated products or services, merchants can mark it as spam to immediately hide it from customers.
Use the
mutation to:- Hide promotional or malicious comments from public view
- Protect customers from potentially harmful links
- Maintain professional discussion quality on blog articles
Spam-marked comments can be reviewed later and potentially restored using the
mutation if they were incorrectly classified.- •ID!required
The ID of the comment to be marked as spam.
Arguments