Add sorting functionality to workspace GraphQL queries with a new WorkspacesOrderBy enum
MR: Pending <!-- NOTE: For context on MR heading, see: https://handbook.gitlab.com/handbook/engineering/devops/dev/create/remote-development/index.html#relationship-of-issues-to-mrs --> ## Description As part of our [new designs for Workspaces](https://gitlab.com/groups/gitlab-org/-/epics/18674), 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](https://gitlab.com/gitlab-org/gitlab/-/issues/562370/designs/sortdropdown.png#note_2702232410) 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 <!-- NOTE: Feel free to expand with more sections and headers as needed --> <!-- DO NOT TOUCH BELOW -->
issue