Add admin_web_path and admin_edit_path GraphQL fields
What does this MR do and why?
Related to #560248
Currently we are building URLs for admin area group/project lists on the frontend - app/assets/javascripts/admin/groups/index/constants.js#L47
This isn't ideal and can lead to bugs, it is better to use the backend as SSOT for URLs.
This MR exposes admin_web_path and admin_edit_path fields on Group and Project GraphQL fields so they can be used on the frontend.
Screenshots or screen recordings
As an admin
As a non-admin
How to set up and validate locally
- Sign in as an admin
- Go to
/-/graphql-explorer - Run the following query
{
adminGroups(first: 2) {
nodes {
... on Group {
fullName
adminWebPath
adminEditPath
}
}
}
adminProjects(first: 2) {
nodes {
... on Project {
nameWithNamespace
adminWebPath
adminEditPath
}
}
}
}
- Go to
/admin/usersand impersonate a regular user - Run the GraphQL query again,
adminWebPathandadminEditPathshould be null.
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 Peter Hegman

