I have the following query
UserReaction.query().where({
target_id: userId,
type,
})
.withGraphFetched('[user.[user_data, reactions]]')
.modifyGraph('user.reactions', builder => {
builder.where('user_id', '=', userId)
})
This works and returns what I want, except I want user_reactions.user.reactions
(the item in the .modifyGraph
) to be a boolean with a different alias (currently it returns as an array of objects).