Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[$300 in SQT] Query Service: Order by null order #2387

Open
stwiname opened this issue May 5, 2024 · 1 comment
Open

[$300 in SQT] Query Service: Order by null order #2387

stwiname opened this issue May 5, 2024 · 1 comment
Labels
guild Tasks that are available via the guild Query Service

Comments

@stwiname
Copy link
Collaborator

stwiname commented May 5, 2024

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 otherwise orderByNull: NULL_OPTION
@stwiname stwiname changed the title Query Service: Order by null order [$300 in SQT] Query Service: Order by null order May 5, 2024
@stwiname stwiname added the guild Tasks that are available via the guild label May 14, 2024
@stwiname
Copy link
Collaborator Author

@Faizalhidayat please make a pull request, we don't accept comments with example code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
guild Tasks that are available via the guild Query Service
Projects
Status: Open Tasks!
Development

No branches or pull requests

1 participant