subql
subql copied to clipboard
[$300 in SQT] Query Service: Order by null order
When we order by ANY nullable field with DESC order, nulls are always on top. That’s related to the default postgres ordering params, with NULLS FIRST set for DESC ordering.
Postgraphile has an untested example of a plugin for this https://www.graphile.org/postgraphile/make-add-pg-table-order-by-plugin/#makeaddpgtableorderbyplugin
Requirements:
- Backwards compatibility, any ordering queries should still work with any changes.
- Specifying the null order should be achieved by providing a new argument. eg
orderBy: [ENTITY_FIELD_ASC, NULL_OPTION]
if it doesn't break compatibility otherwiseorderByNull: NULL_OPTION