I’m trying to make this query work:
const userdata = await User.query() .where('id', auth.user.id) .select('id, username, last_visit') .with('group') .first()
It works without the
- When there is no select, all fields in the users database are loaded and the relationship with
postsis also loaded.
- But when I put the select in the query, the relation stops running (group returns undefined).
My question is: How can I use select (for the users table) and with (for the group relation) at the same time?