summaryrefslogtreecommitdiffstats
path: root/src/services/graphql/comments.query.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/services/graphql/comments.query.ts')
-rw-r--r--src/services/graphql/comments.query.ts37
1 files changed, 24 insertions, 13 deletions
diff --git a/src/services/graphql/comments.query.ts b/src/services/graphql/comments.query.ts
index ef93e89..5110db3 100644
--- a/src/services/graphql/comments.query.ts
+++ b/src/services/graphql/comments.query.ts
@@ -1,21 +1,32 @@
/**
* Query the comments data by post id.
*/
-export const commentsQuery = `query CommentsByPostId($contentId: ID!) {
- comments(where: {contentId: $contentId, order: ASC, orderby: COMMENT_DATE}) {
- nodes {
- approved
- author {
- node {
- gravatarUrl
- name
- url
+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
}
- content
- databaseId
- date
- parentDatabaseId
+ }
+ pageInfo {
+ hasNextPage
+ endCursor
}
}
}`;