Skip to main content
object

Requires read_content access scope or read_online_store_pages access scope.

A comment on an article.

Article

The article associated with the comment.

CommentAuthor!
non-null

The comment’s author.

String!
non-null

The content of the comment.

HTML!
non-null

The content of the comment, complete with HTML formatting.

DateTime!
non-null

The date and time when the comment was created.

EventConnection!
non-null

The paginated list of events associated with the host subject.

Arguments

Int

The first n elements from the paginated list.

String

The elements that come after the specified cursor.

Int

The last n elements from the paginated list.

String

The elements that come before the specified cursor.

Boolean
Default:false

Reverse the order of the underlying list.

EventSortKeys
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.

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.

string

The action that occured.

Example:

  • action:create
Anchor to comments
boolean

Whether or not to include comment-events in your search, passing false will exclude comment-events, any other value will include comment-events.

Example:

  • false
  • true
Anchor to created_at
time

Filter by the date and time when the event happened.

Example:

  • created_at:>2020-10-21
  • created_at:<now
id

Filter by id range.

Example:

  • id:1234
  • id:>=1234
  • id:<=1234
Anchor to subject_type
string

The resource type affected by this event. See EventSubjectType for possible values.

Example:

  • PRODUCT_VARIANT
  • PRODUCT
  • COLLECTION

ID!
non-null

A globally-unique ID.

String

The IP address of the commenter.

Boolean!
non-null

Whether or not the comment is published.

DateTime

The date and time when the comment was published.

CommentStatus!
non-null

The status of the comment.

DateTime

The date and time when the comment was last updated.

String

The user agent of the commenter.


Was this section helpful?

query

Returns a Comment resource by ID.

Arguments

ID!
required

The ID of the Comment to return.


query

List of the shop's comments.

Arguments

Int

The first n elements from the paginated list.

String

The elements that come after the specified cursor.

Int

The last n elements from the paginated list.

String

The elements that come before the specified cursor.

Boolean
Default:false

Reverse the order of the underlying list.

CommentSortKeys
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.

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.

Example:

  • query=Bob Norman
  • query=title:green hoodie
Anchor to created_at
time

Filter by the date and time when the comment was created.

Example:

  • created_at:>'2020-10-21T23:39:20Z'
  • created_at:<now
  • created_at:<=2024
id

Filter by id range.

Example:

  • id:1234
  • id:>=1234
  • id:<=1234
Anchor to published_at
time

Filter by the date and time when the comment was published.

Example:

  • published_at:>'2020-10-21T23:39:20Z'
  • published_at:<now
  • published_at:<=2024
Anchor to published_status
string

Filter by published status

Valid values:

  • any
  • published
  • unpublished

Example:

  • published_status:any
  • published_status:published
  • published_status:unpublished
string
Anchor to updated_at
time

Filter by the date and time when the comment was last updated.

Example:

  • updated_at:>'2020-10-21T23:39:20Z'
  • updated_at:<now
  • updated_at:<=2024


Was this section helpful?

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 commentApprove 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.

Arguments

ID!
required

The ID of the comment to be approved.


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 commentNotSpam 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.

Arguments

ID!
required

The ID of the comment to be marked as not spam.


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 commentSpam 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 commentNotSpam mutation if they were incorrectly classified.

Arguments

ID!
required

The ID of the comment to be marked as spam.



Was this section helpful?


Was this section helpful?