Skip to main content

getPostsById method

String getPostsById (String orgId)

Getting Posts by Id.

params:

  • orgId: The organisation id

returns:

  • String: The query related to gettingPostsbyId

Implementation

String getPostsById(String orgId) {
return """
query {
postsByOrganization(id: "$orgId",orderBy: createdAt_DESC )
{
_id
text
createdAt
imageUrl
videoUrl
title
commentCount
likeCount
creator{
_id
firstName
lastName
image
}
organization{
_id
}
likedBy{
_id
}
comments{
_id
}
}
}
""";
}