Add :admin_projects GraphQL endpoint for /admin/projects page
What does this MR do and why?
This MR adds a dedicated :admin_projects GraphQL endpoint specifically for the /admin/projects page, replacing the previous approach of reusing the :projects endpoint (reverted in !200906 (merged)).
The endpoint returns projects as ProjectInterface which can either be ProjectType or ProjectMinimalAccessType depending on the current user's permission on the project (read_project or only read_project_metadata).
Why
The existing :projects endpoint is widely used throughout the application. Modifying it to return ProjectInterface types introduces high risk of backward compatibility issues (e.g. existing queries will need to specify which concrete type a field belongs to1). A dedicated :admin_projects endpoint scopes the ProjectInterface usage to the admin projects page only, reducing risk.
1
// if projects field is updated to return ProjectInterface instead of ProjectType
// before
projects {
nodes {
a_field_in_project_type
a_field_in_project_type
}
}
// after
projects {
nodes {
... on Project {
a_field_in_project_type
a_field_in_project_type
}
}
}
References
Allow read-only access to `Admin Area > Project... (#557844 - closed).
Screenshots or screen recordings
| Before | After |
|---|---|
How to set up and validate locally
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.