Add admin_show_path and admin_edit_path GraphQL fields

What does this MR do and why?

Related to #560248 (closed)

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_show_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-14_at_9.59.18_AM

As a non-admin

Screenshot_2025-11-14_at_9.59.38_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
        adminShowPath
        adminEditPath
      }
    }
  }
  adminProjects(first: 2) {
    nodes {
      ... on Project {
        nameWithNamespace
        adminShowPath
        adminEditPath
      }
    }
  }
}
  1. Go to /admin/users and impersonate a regular user
  2. Run the GraphQL query again, adminShowPath 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