import { connectionFromArray , connectionFromPromisedArray } from 'common/utils' ; import { DraftToCollectionResolver } from 'definitions' ; const resolver = ( { collection } , { input } , { dataSources : { articleService } } ) => { if ( ! collection || collection . length === 0 ) { return connectionFromArray ( [ ] , input ) ; } return connectionFromPromisedArray ( articleService . draftLoader . loadMany ( collection ) , input ) ; } ; export default resolver ;