import { connectionFromPromisedArray , fromConnectionArgs } from 'common/utils' ; import { CommentToCommentsResolver } from 'definitions' ; const resolver = ( { id } , { input : { author , sort , ... connectionArgs } } , { dataSources : { commentService } } ) => { const { take , skip } = fromConnectionArgs ( connectionArgs , { allowTakeAll : true , } ) ; return connectionFromPromisedArray ( commentService . findByParent ( { id , author , sort , skip , take } ) , connectionArgs ) ; } ; export default resolver ;