Closed moseleyi closed 6 years ago
I don't know that include
supports order
?
In GraphQL, unless you always include that model, you generally want to use a subquery for ordering.
Otherwise, include ordering is something like (on the main query part) order: [[People, 'last_logged_in', 'DESC NULLS LAST']]
@moseleyi I think you can achieve it like this: https://github.com/mickhansen/graphql-sequelize/issues/573#issuecomment-373812402
I think I saw somewhere how to use the following syntax:
$table.column$
but I can't find it, hopefully you guys can refresh my memory.I have main table called
Organizations
, inbefore
function I'm includinghasMany
model calledorganizationPeople
that is a junction table, I usedseparate : true
, to run it in separate query. Next theres another include toUsers
module (to get the person's name). Now I would like to order the results of that query by a column fromUsers
.This is a mock up of my current
before
:The
last_logged_in
column is onUsers
table, how can I reference it?