Skip to content

Added gql query to get list of pending memberApprovals for group/project

Suraj Tripathi requested to merge suraj_list_member_approval_graphql into master

What does this MR do and why?

Added gql query to get list of pending memberApprovals for group/project

  • We already share the pending members through the controllers(project, group).
  • This query exposes the same data through graphql to allow frontend to query just this data and make UI changes if required.

PS: These changes are currently behind a feature-flag and not available on prod.

Changelog: added EE: true

ref: #474218 (closed)

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Graphiql for Project

Screenshot 2024-07-18 at 9.58.06 PM.png

GraphiQL for Group

Screenshot 2024-07-18 at 9.57.26 PM.png

How to set up and validate locally

  1. Go to your local graphiql page http://localhost:3000/-/graphql-explorer
  2. Ensure you have pending MembersApproval. Follow steps mentioned here to add some.
  3. Check the list for Group and Project
    1. Sample group query

      query {
        group(fullPath: "gitlab-org") {
          pendingMemberApprovals(first:1) {
            edges {
              node {
                user {
                  id
                  username
                }
                member {
                  __typename
                  id
                  accessLevel {
                    stringValue
                  }
                }
                createdAt
                newAccessLevel {
                  stringValue
                }
                oldAccessLevel {
                  stringValue
                }
                status
              }
            }
            pageInfo {
              hasNextPage
              hasPreviousPage
              startCursor
              endCursor
          	}
          }
      	}
      }
    2. Sample project query

      query {
        project(fullPath: "gitlab-org/gitlab-shell") {
          pendingMemberApprovals(first:1) {
            edges {
              node {
                user {
                  id
                  username
                }
                member {
                  __typename
                  id
                  accessLevel {
                    stringValue
                  }
                }
                createdAt
                newAccessLevel {
                  stringValue
                }
                oldAccessLevel {
                  stringValue
                }
                status
              }
            }
            pageInfo {
              hasNextPage
              hasPreviousPage
              startCursor
              endCursor
            }
          }
        }
      }
Edited by Suraj Tripathi

Merge request reports

Loading