Skip to content

fix: enable orderBy on all columns alongside filterBy in v5 plugin#937

Merged
pyramation merged 2 commits intomainfrom
fix/orderby-not-working-v5
Mar 31, 2026
Merged

fix: enable orderBy on all columns alongside filterBy in v5 plugin#937
pyramation merged 2 commits intomainfrom
fix/orderby-not-working-v5

Conversation

@yyyyaaa
Copy link
Copy Markdown
Contributor

@yyyyaaa yyyyaaa commented Mar 30, 2026

The problem: PostGraphile v5's PgIndexBehaviorsPlugin adds both -filterBy and -orderBy to non-indexed columns. The existing
EnableAllFilterColumnsPlugin only restored filterBy — it missed re-enabling orderBy.

The fix (this diff): Adds 'orderBy' alongside 'filterBy' in the behavior callback (line 77):
// Before
return [behavior, 'filterBy'];
// After
return [behavior, 'filterBy', 'orderBy'];

Impact: Without this, any column that doesn't have a database index would be missing from the orderBy enum in GraphQL
connections — meaning clients couldn't sort by those columns. This is a significant gap since the plugin's intent was always
to remove v5's index-only restriction.

@yyyyaaa yyyyaaa requested a review from pyramation March 30, 2026 22:11
@yyyyaaa
Copy link
Copy Markdown
Contributor Author

yyyyaaa commented Mar 30, 2026

this is needed for the sorting by column features in dashboard side:

Kapture.2026-03-31.at.05.12.20.mp4

@pyramation pyramation merged commit 7222a5b into main Mar 31, 2026
43 checks passed
@pyramation pyramation deleted the fix/orderby-not-working-v5 branch March 31, 2026 01:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants