I've got an auth_token
table and user
table. I'd like to resolve a user from a given auth token using the query builder. The issue I'm having is that after joining, the return type still thinks it's going to be an AuthToken
. Is there a way to tell the query builder to use the joined entity instead?
return await this.authTokenRepository
.createQueryBuilder()
.where({
token: token
})
.innerJoinAndSelect(User, 'user')
.getOne();