import { ARTICLE_ACCESS_TYPE } from 'common/enums' ; import { ArticleAccessToTypeResolver } from 'definitions' ; export const type = async ( { articleId } , _ , { dataSources : { articleService } } ) => { const articleCircle = await articleService . findArticleCircle ( articleId ) ; if ( ! articleCircle ) { return ARTICLE_ACCESS_TYPE . public ; } if ( articleCircle . access === ARTICLE_ACCESS_TYPE . public ) { return ARTICLE_ACCESS_TYPE . public ; } return ARTICLE_ACCESS_TYPE . paywall ; } ;