Can’t make query: select() and with()

So here is my query

await Order
      .query()
      .with('order_status')
      .select('delivery_date')
      .fetch()

The result would be:

[{
   delivery_date: "2020-08-29"
   order_status: null
}]

as you can see the order_status is null, but when I removed the .select the order_status is not null

Gave up using .with, just used .leftJoin got what I needed to do

1 Like

With explicit select you need to select all fields required for query. Including fields like delivery_id, status_id etc