Skip to main content

Comment Queries

Get Comment

Retrieve a specific comment by its ID.

Query Structure

query GetComment($id: String!) {
comment(id: $id) {
id
dateCreated
text
type
moderationStatus
isLiked
likeCount
files {
id
url
}
post {
id
title
}
user {
ssoId
name
}
likers {
ssoId
name
}
notifyOP
notifyCommenters
notifyUpVoters
notifyDownVoters
notifySubscribers
}
}

Input Fields

FieldTypeDescription
idString!Comment ID

Return Type

Returns a Comment object with the following fields:

FieldTypeDescription
idString!Comment ID
dateCreatedDateTime!Date comment was created
files[File]Files attached to comment
isLikedBoolean!Is comment liked by current user
likeCountInt!Like counts for that comment
likers[User]!List of users that liked the comment
moderationStatusCommentModerationStatusModeration status of the comment
moderatorUserUser that moderated the comment
notifyOPBooleanWhether to notify the original post author
notifyCommentersBooleanWhether to notify other commenters
notifyUpVotersBooleanWhether to notify users who upvoted
notifyDownVotersBooleanWhether to notify users who downvoted
notifySubscribersBooleanWhether to notify post subscribers
postPost!Post that the comment belongs to
textString!Text of the comment
typeCommentType!Type of comment (usually all user generated are BASIC)
userUser!User that created the comment

CommentType Enum

ValueDescription
BASICComment on a post (only type supported for users)
LOCKEDAuto generated
MERGE_SOURCEAuto generated
MERGE_TARGETAuto generated
STATUS_CHANGEAuto generated
TITLE_CHANGEAuto generated
UNLOCKEDAuto generated

Example

query {
comment(id: "comment_123") {
id
text
dateCreated
isLiked
likeCount
user {
ssoId
name
}
}
}

Example Response:

{
"data": {
"comment": {
"id": "comment_123",
"text": "This is a great feature!",
"dateCreated": "2024-01-01T12:00:00Z",
"isLiked": false,
"likeCount": 5,
"user": {
"ssoId": "user_456",
"name": "John Doe"
}
}
}
}

Authentication

This query requires authentication. You must include your API key in the HTTP headers:

{
"apikey": "YOUR_API_KEY"
}

Error Handling

The query may return errors in the following cases:

  • Invalid API key
  • Comment not found
  • Comment belongs to a different board
  • Comment is from a non-SSO user

Example error response:

{
"errors": [
{
"message": "Comment not found",
"path": ["comment"]
}
]
}