summaryrefslogtreecommitdiffstats
path: root/src/services/graphql/comments.query.ts
blob: 5110db3c943918e19ee51e374b5729933abf78c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/**
 * Query the comments data by post id.
 */
export const commentsQuery = `query CommentsByPostId($contentId: ID!, $first: Int = 10, $after: String = "") {
  comments(
    where: {contentId: $contentId}
    first: $first
    after: $after
  ) {
    edges {
      cursor
      node {
        approved
        author {
          node {
            gravatarUrl
            name
            url
          }
        }
        content
        databaseId
        date
        parentDatabaseId
      }
    }
    pageInfo {
      hasNextPage
      endCursor
    }
  }
}`;