Retrieve Posts
Retrieve Information about a Post
post
query is used to retrieve information about a post.
It takes id
as an input.
- GraphQL
- JS Client
{
post(id: "NHzqSd4upYWuSkb") {
title
shortContent
}
}
client.posts.get({
id: 'NHzqSd4upYWuSkb',
})
List of Posts
posts
query is used to get a list of posts.
It returns a paginated list of posts. It takes pagination parameters as inputs.
You can also filter the list using filterBy
, postTypeIds
, spaceIds
, and orderBy
inputs.
- GraphQL
- JS Client
{
posts(limit: 10) {
nodes {
id
title
shortContent
}
}
}
client.posts.list({
limit: 10,
})
Feed
feed
query is similar to posts query and is optimized
for showing the posts in the feed.
It returns a paginated list of posts. It takes pagination parameters as inputs.
You can also filter the list using postTypeIds
, onlyMemberSpace
, and orderBy
inputs.
- GraphQL
- JS Client
{
feed(limit: 10, ) {
nodes {
id
title
shortContent
reactions {
count
reaction
}
}
}
}
client.posts.feed({
limit: 10,
})