import { Class , FetchUser } from '@foal/core' ; import { getRepository } from 'typeorm' ; export param { ( Class < { id : number | string } > ) } userEntityClass returns { FetchUser } export function fetchUser ( userEntityClass ) { return ( id ) => getRepository ( userEntityClass ) . findOne ( { id } ) ; }