import Resort from '@entities/Resort' ; import { Arg , Query , Resolver } from 'type-graphql' ; @ Resolver ( ) export default class GetResortByNameResolver { @ Query ( ( ) => Resort , { nullable : true } ) getResortByName ( @ Arg ( 'name' ) name ) { return Resort . createQueryBuilder ( 'resort' ) . where ( 'LOWER(resort.name) = LOWER(:name)' , { name } ) . getOne ( ) ; } }