loopback-next icon indicating copy to clipboard operation
loopback-next copied to clipboard

[@loopback/sequelize] Unable to order by associations using "order" filter

Open KalleV opened this issue 1 year ago • 0 comments

Describe the bug

Sequelize provides support for ordering by associations: ordering-eager-loaded-associations.

However, this functionality is currently prevented by the loopback order filter conversion because it assumes the order filter will only contain 1-2 elements (e.g. "title ASC").

Attempting to apply an order via the nested include filters is too limited since it only works for hasMany relations.

Logs

No response

Additional information

Related information:

  • https://github.com/sequelize/sequelize/issues/4553
  • https://stackoverflow.com/a/46098341

Reproduction

https://github.com/loopbackio/loopback-next/pull/10375

KalleV avatar Feb 16 '24 23:02 KalleV