Add additional query filters to work items GQL
What does this MR do and why?
This MR introduces new filtering options for work items, including the ability to filter by creation date, update date, due date, closure date and health status. The changes affect the GraphQL API.
Note that although the linked issue mentions filtering by progress, this will be completed in a seperate MR, as there's performance concerns around the database query needed to perform this filtering, which can be merged at a later time.
| Example request | Example response |
|---|---|
query q { group(fullPath: "gitlab-org") { workItems(healthStatus: onTrack) { nodes { id } } }} |
{"data": { "group": { "workItems": { "nodes": [{"id": "gid://gitlab/WorkItem/627"}, ...]}}}, "correlationId": "01JJAW7G27F1RE413B02GRDRZB"} |
References
MR acceptance checklist
-
You have self-reviewed this MR per code review guidelines. -
The code follows the software design guidelines. -
Ensure automated tests exist following the testing pyramid. Add missing tests or create an issue documenting testing gaps. -
You have considered the technical impacts on GitLab.com, Dedicated and self-managed. -
You have considered the impact of this change on the frontend, backend, and database portions of the system where appropriate and applied the ~ux, frontend, backend, and database labels accordingly. -
You have tested this MR in all supported browsers, or determined that this testing is not needed. -
You have confirmed that this change is backwards compatible across updates, or you have decided that this does not apply. -
You have properly separated EE content (if any) from FOSS. Consider running the CI pipelines in a FOSS context. -
You have considered that existing data may be surprisingly varied. For example, if adding a new model validation, consider making it optional on existing data. -
You have fixed flaky tests related to this MR, or have explained why they can be ignored. Flaky tests have error Flaky test '<path/to/test>' was found in the list of files changed by this MR. but can be in jobs that pass with warnings.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
| Before | After |
|---|---|
![]() |
![]() |
How to set up and validate locally
- In a browser, on a device with the GDK running, navigate to http://localhost:3000/-/graphql-explorer
- Write a query to fetch work items. e.g.
query q {
group(fullPath: "toolbox") {
workItems {
nodes {
id
}
}
}
}
- Include additional filters as required (i.e.
createdBefore,createdAfter,updatedBefore,updatedAfter,dueBefore,dueAfter,closedBefore,closedAfter,healthStatus,weight). e.g.
query q {
group(fullPath: "toolbox") {
workItems(createdAfter: "2025-01-01T00:00:00") {
nodes {
id
}
}
}
}
- Observe the work items returned respect the filters applied
Database changes
Query Plan
Bounded variant
Unbounded variant
SQL
bounded_range_paginated.sql
unbounded_range_paginated.sql
Note that there are no longer database changes included in this MR, as the database changes required for the progress filter will be completed in a seperate MR.
Related to #513308 (closed)

