Add sorting functionality to workspace GraphQL queries with a new WorkspacesOrderBy enum
MR: Pending
Description
As part of our new designs for Workspaces, we need to add comprehensive sorting functionality to workspace GraphQL queries so that users can sort workspaces by various criteria. This implementation will also provide a foundation for future admin interface improvements and enable enterprise admins to leverage this API for reporting and automation tools.
Acceptance criteria
-
Create new WorkspacesOrderBy
enum with following sorting options:-
CREATED_AT
- sort by workspace creation time -
UPDATED_AT
- sort by last workspace update (backing field for "Recent Activity") -
NAME
- sort by workspace name alphabetically -
ACTUAL_STATE_UPDATED_AT
- sort by when workspace state last changed -
PROJECT_ID
- sort by project ID (GraphQL API only, not exposed in UI) -
PROJECT_NAME
- sort by project name -
USER_ID
- sort by user ID (GraphQL API only, not exposed in UI) -
USER_NAME
- sort by user name
-
-
Implement sorting logic in workspace Finder class -
Add orderBy
field to all existing workspace GraphQL queries -
Update GraphQL schema documentation for all enum values
TODO: Implementation plan
Technical Notes
Implementation Reference: Refer this comment from @cwoolley-gitlab
Sorting with project name & user name would require conditional join with the respective table in the ActiveRecord query.
Future Benefits: This GraphQL sorting capability will support:
- Current workspace list UI improvements
- Future admin interfaces for workspace reporting
- Enterprise admin custom reporting and automation tools
Edited by Sahil Sharma