import { EntityRepository , Repository } from 'typeorm' ; import { User } from '../entity' ; @ EntityRepository ( User ) export class UserRepository extends Repository < User > { async findByEmail ( email ) { return this . findOne ( { where : { email } , relations : [ 'profile' , 'role' ] } ) ; } }