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

Screenshot_2025-11-03_at_11.49.19_AM

As a non-admin

Screenshot_2025-11-03_at_11.49.44_AM

How to set up and validate locally

  1. Sign in as an admin
  2. Go to /-/graphql-explorer
  3. Run the following query
{
  adminGroups(first: 2) {
    nodes {
      ... on Group {
        fullName
        adminWebPath
        adminEditPath
      }
    }
  }
  adminProjects(first: 2) {
    nodes {
      ... on Project {
        nameWithNamespace
        adminWebPath
        adminEditPath
      }
    }
  }
}
  1. Go to /admin/users and impersonate a regular user
  2. Run the GraphQL query again, adminWebPath and adminEditPath should 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

Merge request reports

Loading