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
| Field | Type | Description |
|---|---|---|
id | String! | Comment ID |
Return Type
Returns a Comment object with the following fields:
| Field | Type | Description |
|---|---|---|
id | String! | Comment ID |
dateCreated | DateTime! | Date comment was created |
files | [File] | Files attached to comment |
isLiked | Boolean! | Is comment liked by current user |
likeCount | Int! | Like counts for that comment |
likers | [User]! | List of users that liked the comment |
moderationStatus | CommentModerationStatus | Moderation status of the comment |
moderator | User | User that moderated the comment |
notifyOP | Boolean | Whether to notify the original post author |
notifyCommenters | Boolean | Whether to notify other commenters |
notifyUpVoters | Boolean | Whether to notify users who upvoted |
notifyDownVoters | Boolean | Whether to notify users who downvoted |
notifySubscribers | Boolean | Whether to notify post subscribers |
post | Post! | Post that the comment belongs to |
text | String! | Text of the comment |
type | CommentType! | Type of comment (usually all user generated are BASIC) |
user | User! | User that created the comment |
CommentType Enum
| Value | Description |
|---|---|
BASIC | Comment on a post (only type supported for users) |
LOCKED | Auto generated |
MERGE_SOURCE | Auto generated |
MERGE_TARGET | Auto generated |
STATUS_CHANGE | Auto generated |
TITLE_CHANGE | Auto generated |
UNLOCKED | Auto 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"]
}
]
}