Make groups GraphQL query countable and add active argument

What does this MR do and why?

Related to Add `active` argument to `GroupsResolver` (#542571 - closed) and Add counts to tabs (#502494 - closed)

  • Needed for &13781 (closed) and &17783 (closed)
  • Make groups GraphQL query countable
  • Add active argument
    • Defaults to nil which returns all groups (no changes to existing behavior)
    • When true it returns only groups that are not pending deletion. Archived groups will also be excluded when we introduce group archiving in the future.
    • When false it returns only groups that are pending deletion. Archived groups will also be included when we introduce group archiving in the future.

How to set up and validate locally

  1. Delete a group in group -> Settings -> General -> Advanced. This should put it in pending deletion state.
  2. Go to /-/graphql-explorer
  3. Run this query
{
  groups(active: false) {
    nodes {
      fullName
    }
    count
  }
}
  1. It should only return the group that is pending deletion

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.

Merge request reports

Loading