import { correctHtml } from 'common/utils' ; import { DraftToContentResolver } from 'definitions' ; const resolver = async ( { authorId , content } , _ , { viewer } ) => { const isAdmin = viewer . hasRole ( 'admin' ) ; const isAuthor = authorId === viewer . id ; if ( isAdmin || isAuthor ) { return correctHtml ( content ) ; } return '' ; } ; export default resolver ;