Post Queries
Get Post
Retrieve a specific post by its ID.
Query Structure
query GetPost(
$id: String!
$assignCursor: String
$assignLimit: Int
$commentCursor: String
$voteLimit: String
$voteCursor: Int
) {
post(id: $id) {
id
pid
title
excerpt
dateCreated
dateCompleted
isLocked
isPinned
isSample
isSubscribed
upvoteCount
downvoteCount
commentCount
moderationStatus
moderatedBy
moderator {
id
name
}
board {
id
name
}
properties {
id
parent
type
values
}
assignments(cursor: $assignCursor, limit: $assignLimit$) {
nodes {
user {
ssoId
name
}
assignedBy {
ssoId
name
}
}
hasMore
cursor
}
comments(cursor: $commentCursor) {
nodes {
id
text
}
hasMore
cursor
chunkSize
}
votes(cursor: $voteCursor, limit: $voteLimit) {
nodes {
id
type
}
hasMore
cursor
}
}
}
Input Fields
| Field | Type | Description |
|---|---|---|
id | String! | Post ID |
Get Posts
Retrieve a list of posts from a board with filtering and sorting options.
Query Structure
query GetPosts(
$cursor: String
$filters: [PostFilter!]
$limit: Int
$sort: PostSortOrder
) {
posts(
cursor: $cursor
filters: $filters
limit: $limit
sort: $sort
) {
nodes {
id
title
excerpt
upvoteCount
downvoteCount
commentCount
dateCreated
isLocked
isPinned
}
hasMore
cursor
}
}
Input Fields
| Field | Type | Description |
|---|---|---|
cursor | String | Pagination cursor |
filters | [PostFilter!] | List of filters to apply |
limit | Int | Number of posts to return |
sort | PostSortOrder | Sort order for the posts |
PostFilter Input
| Field | Type | Description |
|---|---|---|
type | PostFilterType! | Type of filter (FIELD or STATUS) |
label | String | Label for the filter |
is | String | Matcher for exact value |
empty | String | Matcher for empty value |
PostSortOrder Enum
| Value | Description |
|---|---|
TRENDING | Sort by trending score |
TOP | Sort by top score |
NEWEST | Sort by creation date (newest first) |
COMPLETED | Sort by completion date |
Return Type
The Post type includes the following fields:
| Field | Type | Description |
|---|---|---|
id | String! | Post ID |
board | Board! | Board to which the post belongs |
comments | PostCommentsPayload! | Comments of the post |
commentCount | Int! | Comments count of the post |
dateCompleted | DateTime | Date this post was marked completed |
dateCreated | DateTime! | Date this post was created |
downvoteCount | Int! | Count of downvotes of the post |
excerpt | String | Summary of the post (usually first comment) |
isLocked | Boolean! | Post is locked or not |
isDownvoted | Boolean! | Post is downvoted or not |
isUpvoted | Boolean! | Post is upvoted or not |
isSample | Boolean! | Post is sample or not |
isSubscribed | Boolean! | Post is subscribed or not (by the current user) |
isPinned | Boolean! | Post is pinned or not |
mergedIntoPost | String | Post ID of the post this post was merged into |
moderationStatus | PostModerationStatus | Moderation status of the post |
moderatedBy | String | UserID who moderated the post |
moderator | User | User who moderated the post |
pid | String! | Unique identifier of the post (usually a number specific to the board) |
properties | [PostProperty!]! | Post properties (Refers to the custom fields created) |
title | String! | Title of the post |
statusId | String! | Status of post (if custom status is created) and null defaults are being used |
upvoteCount | Int! | Count of upvotes of the post |
votes | VotesPayload | Votes of the post |
assignments | AssignmentsPayload! | List of users assigned to the post |
PostModerationStatus Enum
| Value | Description |
|---|---|
APPROVED | Post has been approved |
REJECTED | Post has been rejected |
FLAGGED | Post has been flagged for review |
PENDING | Post is pending moderation |
AssignmentsPayload
| Field | Type | Description |
|---|---|---|
nodes | [Assign!]! | List of assignments |
hasMore | Boolean! | Whether there are more assignments |
cursor | String | Cursor for pagination |
Assign Type
| Field | Type | Description |
|---|---|---|
user | User! | The user who is assigned |
assignedBy | User! | The user who made the assignment |
Example
query {
posts(
sort: NEWEST
limit: 10
filters: [
{ type: STATUS, is: "OPEN" }
]
) {
nodes {
id
title
excerpt
upvoteCount
commentCount
dateCreated
}
hasMore
cursor
}
}
Example Response:
{
"data": {
"posts": {
"nodes": [
{
"id": "post_123",
"title": "Add dark mode support",
"excerpt": "It would be great to have dark mode...",
"upvoteCount": 15,
"commentCount": 3,
"dateCreated": "2024-01-01T12:00:00Z"
}
],
"hasMore": true,
"cursor": "cursor_xyz"
}
}
}
Authentication
All post queries require authentication. You must include your API key and SSO information in the HTTP headers:
{
"apikey": "YOUR_API_KEY",
"ssotype": "YOUR_SSO_TYPE",
"ssoid": "YOUR_SSO_ID"
}
Error Handling
The queries may return errors in the following cases:
- Invalid API key
- Missing SSO type in headers
- Missing SSO ID in headers
- Invalid Post ID
- Post not found
- Post belongs to a different board
Example error response:
{
"errors": [
{
"message": "Invalid Post ID.",
"path": ["post"]
}
]
}