Skip to content

Add 'accessLevels' Argument for projectMembers to GraphQL API

Release post

We're excited to announce the addition of the accessLevels argument to the projectMembers field in our GraphQL API. This enhancement allows you to filter project members by specific access levels directly in your API calls, significantly reducing computational overhead when analyzing project permissions at scale. Previously available only for group members, this feature eliminates the need to fetch all project members and filter them client-side, making ownership graph generation and permission auditing across your entire GitLab instance more efficient and resource-friendly. This enhancement is particularly valuable for organizations managing large-scale deployments with complex permission structures.

Problem

The accessLevels argument for projectMembers is not available in the GraphQL API.

For groups, accessLevels are available:

query groupOwners {
  group(fullPath: "group1") {
    groupMembers(accessLevels: OWNER) {
      nodes {
        user {
          username
        }
      }
    }
  }
}

For projects, accessLevels are not available:

query projectOwners {
  project(fullPath: "project1") {
    projectMembers(accessLevels: OWNER) {
      nodes {
        user {
          username
        }
      }
    }
  }
}

Proposal

Add the accessLevels argument for projects to the GraphQL API.

Implementation guide

TBD

Edited by Christina Lohr