import { ARTICLE_STATE } from 'common/enums' ; import { UserStatusToArticleCountResolver } from 'definitions' ; const resolver = async ( { id } , _ , { dataSources : { atomService } } ) => { const count = await atomService . count ( { table : 'article' , where : { authorId : id , state : ARTICLE_STATE . active } , } ) ; return count ; } ; export default resolver ;