dist/find-many.js
function findMany(repository, options) {
    const entityColumns = repository.metadata.columns.map((columnMetadata) => columnMetadata.propertyName);
    const entityManyToOneRelationColumns = repository
        .metadata
        .relations
        .filter((relationMetadata) => relationMetadata.relationType === 'many-to-one' || relationMetadata.relationType === 'one-to-one')
        .map((relationMetadata) => relationMetadata.propertyName);
    return function (source, args, context, info) {
        return __awaiter(this, void 0, void 0, function* () {
            const selectedColumns = Object.keys(graphqlFields(info));
            const selectQueryBuilder = repository.createQueryBuilder(repository.metadata.name.toLowerCase());
            /** Select **/
            const selectFactory = new select_factory_1.SelectFactory(selectQueryBuilder);
            selectFactory
                .select(selectedColumns.filter((select) => entityColumns.includes(select)));
            /** Where **/
            const whereFactory = new where_factory_1.WhereFactory(selectQueryBuilder, entityManyToOneRelationColumns);
            whereFactory
                .where(lodash_1.get(args, 'filter', {}));
            /** Joins **/
            const joinsFactory = new joins_factory_1.JoinsFactory(selectQueryBuilder);
            joinsFactory
                .join(selectedColumns
                .filter((select) => entityManyToOneRelationColumns.includes(select))
                .reduce((selectedRelationColumns, selectedRelationColumn) => {
                selectedRelationColumns[selectQueryBuilder.alias] = selectedRelationColumn;
                return selectedRelationColumns;
            }, {}))
                .join(whereFactory.selectedManyToOneOrOneToOneRelationColumns);
            /** Pagination **/
            const paginateFactory = new paginate_factory_1.PaginateFactory(selectQueryBuilder);
            paginateFactory
                .paginate(lodash_1.get(args, 'pagination', {}));
            /** Order by **/
            const orderFactory = new order_factory_1.OrderFactory(selectQueryBuilder);
            orderFactory
                .order(lodash_1.get(args, 'orderBy', []));
            /** Extend **/
            if (lodash_1.get(options, 'extend')) {
                yield options.extend(selectQueryBuilder);
            }
            /** Execute get many method **/
            return yield selectQueryBuilder.getMany();
        });
    };
}
function findMany(repository, options) {
    const entityColumns = repository.metadata.columns.map((columnMetadata) => columnMetadata.propertyName);
    const entityManyToOneRelationColumns = repository
        .metadata
        .relations
        .filter((relationMetadata) => relationMetadata.relationType === 'many-to-one' || relationMetadata.relationType === 'one-to-one')
        .map((relationMetadata) => relationMetadata.propertyName);
    return function (source, args, context, info) {
        return __awaiter(this, void 0, void 0, function* () {
            const selectedColumns = Object.keys(graphqlFields(info));
            const selectQueryBuilder = repository.createQueryBuilder(repository.metadata.name.toLowerCase());
            /** Select **/
            const selectFactory = new select_factory_1.SelectFactory(selectQueryBuilder);
            selectFactory
                .select(selectedColumns.filter((select) => entityColumns.includes(select)));
            /** Where **/
            const whereFactory = new where_factory_1.WhereFactory(selectQueryBuilder, entityManyToOneRelationColumns);
            whereFactory
                .where(lodash_1.get(args, 'filter', {}));
            /** Joins **/
            const joinsFactory = new joins_factory_1.JoinsFactory(selectQueryBuilder);
            joinsFactory
                .join(selectedColumns
                .filter((select) => entityManyToOneRelationColumns.includes(select))
                .reduce((selectedRelationColumns, selectedRelationColumn) => {
                selectedRelationColumns[selectQueryBuilder.alias] = selectedRelationColumn;
                return selectedRelationColumns;
            }, {}))
                .join(whereFactory.selectedManyToOneOrOneToOneRelationColumns);
            /** Pagination **/
            const paginateFactory = new paginate_factory_1.PaginateFactory(selectQueryBuilder);
            paginateFactory
                .paginate(lodash_1.get(args, 'pagination', {}));
            /** Order by **/
            const orderFactory = new order_factory_1.OrderFactory(selectQueryBuilder);
            orderFactory
                .order(lodash_1.get(args, 'orderBy', []));
            /** Extend **/
            if (lodash_1.get(options, 'extend')) {
                yield options.extend(selectQueryBuilder);
            }
            /** Execute get many method **/
            return yield selectQueryBuilder.getMany();
        });
    };
}
function findMany ( repository , options ) { const entityColumns = repository . metadata . columns . map ( ( columnMetadata ) => columnMetadata . propertyName ) ; const entityManyToOneRelationColumns = repository . metadata . relations . filter ( ( relationMetadata ) => relationMetadata . relationType === 'many-to-one' || relationMetadata . relationType === 'one-to-one' ) . map ( ( relationMetadata ) => relationMetadata . propertyName ) ; return function ( source , args , context , info ) { return __awaiter ( this , void 0 , void 0 , function * ( ) { const selectedColumns = Object . keys ( graphqlFields ( info ) ) ; const selectQueryBuilder = repository . createQueryBuilder ( repository . metadata . name . toLowerCase ( ) ) ; /** Select **/ const selectFactory = new select_factory_1 . SelectFactory ( selectQueryBuilder ) ; selectFactory . select ( selectedColumns . filter ( ( select ) => entityColumns . includes ( select ) ) ) ; /** Where **/ const whereFactory = new where_factory_1 . WhereFactory ( selectQueryBuilder , entityManyToOneRelationColumns ) ; whereFactory . where ( lodash_1 . get ( args , 'filter' , { } ) ) ; /** Joins **/ const joinsFactory = new joins_factory_1 . JoinsFactory ( selectQueryBuilder ) ; joinsFactory . join ( selectedColumns . filter ( ( select ) => entityManyToOneRelationColumns . includes ( select ) ) . reduce ( ( selectedRelationColumns , selectedRelationColumn ) => { selectedRelationColumns [ selectQueryBuilder . alias ] = selectedRelationColumn ; return selectedRelationColumns ; } , { } ) ) . join ( whereFactory . selectedManyToOneOrOneToOneRelationColumns ) ; /** Pagination **/ const paginateFactory = new paginate_factory_1 . PaginateFactory ( selectQueryBuilder ) ; paginateFactory . paginate ( lodash_1 . get ( args , 'pagination' , { } ) ) ; /** Order by **/ const orderFactory = new order_factory_1 . OrderFactory ( selectQueryBuilder ) ; orderFactory . order ( lodash_1 . get ( args , 'orderBy' , [ ] ) ) ; /** Extend **/ if ( lodash_1 . get ( options , 'extend' ) ) { yield options . extend ( selectQueryBuilder ) ; } /** Execute get many method **/ return yield selectQueryBuilder . getMany ( ) ; } ) ; } ; }
Method to find many entity records.

@param {Repository<Entity>} repository
@param {FindManyOptions} options
@returns {(source, args, context, info) => Promise<Entity[]>}
Method to find many entity records .