From d820d2d2c370abd8f63b37e5f5d91767191b9f61 Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Thu, 14 Sep 2017 13:08:01 -0600 Subject: [PATCH] moved support for deepReplyCount to seperate field --- plugins/talk-plugin-deep-reply-count/index.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/plugins/talk-plugin-deep-reply-count/index.js b/plugins/talk-plugin-deep-reply-count/index.js index 92c7a06ef..f46386c62 100644 --- a/plugins/talk-plugin-deep-reply-count/index.js +++ b/plugins/talk-plugin-deep-reply-count/index.js @@ -59,6 +59,13 @@ const genDeepCommentCount = async (context, parent_ids) => { }; module.exports = { + typeDefs: ` + type Comment { + + # deepReplyCount is the count of all decendant replies. + deepReplyCount: Int + } + `, loaders: (context) => ({ Comments: { getDeepCount: new DataLoader((parent_ids) => genDeepCommentCount(context, parent_ids)), @@ -66,7 +73,7 @@ module.exports = { }), resolvers: { Comment: { - replyCount({id}, args, {loaders: {Comments}}) { + deepReplyCount({id}, args, {loaders: {Comments}}) { return Comments.getDeepCount.load(id); } }