From e3e3ea07dbf7d55b137f21145020628d9fb61b59 Mon Sep 17 00:00:00 2001 From: Gisle Aune Date: Wed, 16 Jan 2019 22:05:40 +0100 Subject: [PATCH] graph2: Changed Chapter to not return any comments if mode is disabled, even if there are comments. --- graph2/types/chapter.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/graph2/types/chapter.go b/graph2/types/chapter.go index 3c924c9..880245f 100644 --- a/graph2/types/chapter.go +++ b/graph2/types/chapter.go @@ -29,6 +29,10 @@ func (r *chapterResolver) Comments(ctx context.Context, chapter *models.Chapter, limitValue = *limit } + if !chapter.CommentMode.IsEnabled() { + return nil, nil + } + return comments.ListChapterID(chapter.ID, limitValue) }