Update adminGroups GraphQL endpoint to return project statistics
Problem
When the adminGroups GraphQL endpoint was introduced in !202896 (merged), the projectStatistics sub-field was not properly returned. This occurred because the lookahead functionality in ResolvesGroups didn't handle queries with inline fragments (e.g. nodes { ... on Group { projectStatistics } }).
Solution
This MR updates the ResolvesGroup module to properly handle inline fragments by adding the selected_type: ::Types::GroupType argument to the .selects?(:project_statistics) call.
Changes
- Updates the lookahead functionality in
ResolvesGroupsto correctly detect whenprojectStatisticsis requested in inline fragments - Ensures the
adminGroupsGraphQL endpoint returns complete project statistics data - Adds tests to verify the functionality works as expected
References
Allow read-only access to `Admin Area > Project... (#557844 - closed)
Screenshots or screen recordings
| Before | After |
|---|---|
![]() |
![]() |
How to set up and validate locally
- Enable
read_admin_groupsfeature flag - Login with an admin
- Go to Admin area groups page and verify that groups display project storage size
# To update the storage size of a project
> Project.find(<project_id>).statistics.update!(storage_size: 100.megabytes)
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.
Edited by Eugie Limpin

