Update mutation APIs for ArticleReply, ArticleReplyFeedback, ReplyRequest, ArticleCategory, ArticleCategoryFeedback so that statuses can be filled in according to currently logged-in user is blocked or not
util/user update:
make assertUser accept user from GraphQL context
adjust related unit tests to rely on user in GraphQL context instead, which also simplifies resolver logic
add isUserBlocked tell if current user in GraphQL context is blocked
add getContentDefaultStatus that generates status value for the contents generated by the user in GraphQL context
ArticleReplyFeedback updates:
CreateOrUpdateArticleReplyFeedback uses user in GraphQL context and sets status of new article-reply accordingly
ArticleCategoryFeedback updates:
CreateOrUpdateArticleCategoryFeedback uses user in GraphQL context and sets status of new article-reply accordingly
ReplyRequest updates:
createOrUpdateReplyRequest() function takes user and sets status of new reply requests accordingly
do not update replyRequestCount & lastRequestedAt in article if the status is BLOCKED
CreateOrUpdateReplyRequest resolver is updated due to use of createArticleReply()
ArticleReply updates:
createArticleReply() function takes user and sets status of new article-reply accordingly
CreateArticleReply & CreateReply resolver is updated due to use of createArticleReply()
Expose userId and appId field for easier unit tests
canUpdateStatus & ownVote uses user in GraphQL context
CreateArticle and GetArticle tests are modified to provide mock user instead of userId / appId
UpdateArticleReplyStatus restores deleted article-replies to "BLOCKED" state if the user is blocked
Add BLOCKED value in ArticleReplyStatusEnum
ArticleCategory updates:
Expose userId and appId field for easier unit tests
ownVote uses user in GraphQL context
CreateArticleCategory restores deleted article-replies to "BLOCKED" state if the user is blocked
Coverage increased (+0.1%) to 86.193% when pulling 9cc083853b077a1f01468bb1bf9fa9991490918a on mutation-adds-status into 5e1fbd126ffc46a0f6b0e54009599b6321e81ab7 on master.
Update mutation APIs for
ArticleReply
,ArticleReplyFeedback
,ReplyRequest
,ArticleCategory
,ArticleCategoryFeedback
so that statuses can be filled in according to currently logged-in user is blocked or notutil/user
update:assertUser
acceptuser
from GraphQL contextuser
in GraphQL context instead, which also simplifies resolver logicisUserBlocked
tell if currentuser
in GraphQL context is blockedgetContentDefaultStatus
that generates status value for the contents generated by theuser
in GraphQL contextArticleReplyFeedback
updates:CreateOrUpdateArticleReplyFeedback
usesuser
in GraphQL context and setsstatus
of new article-reply accordinglyArticleCategoryFeedback
updates:CreateOrUpdateArticleCategoryFeedback
usesuser
in GraphQL context and setsstatus
of new article-reply accordinglyReplyRequest
updates:createOrUpdateReplyRequest()
function takesuser
and setsstatus
of new reply requests accordinglyreplyRequestCount
&lastRequestedAt
in article if the status isBLOCKED
CreateOrUpdateReplyRequest
resolver is updated due to use ofcreateArticleReply()
ArticleReply
updates:createArticleReply()
function takesuser
and setsstatus
of new article-reply accordinglyCreateArticleReply
&CreateReply
resolver is updated due to use ofcreateArticleReply()
userId
andappId
field for easier unit testscanUpdateStatus
&ownVote
usesuser
in GraphQL contextCreateArticle
andGetArticle
tests are modified to provide mockuser
instead of userId / appIdUpdateArticleReplyStatus
restores deleted article-replies to "BLOCKED" state if the user is blockedBLOCKED
value inArticleReplyStatusEnum
ArticleCategory
updates:userId
andappId
field for easier unit testsownVote
usesuser
in GraphQL contextCreateArticleCategory
restores deleted article-replies to "BLOCKED" state if the user is blockedBLOCKED
value inArticleCategoryStatusEnum