Skip to content

Fix N+1 queries when selecting accessLevelDescription

Jerry Seto requested to merge 470611-fix-n+1-on-branch-rules-graphql into master

What does this MR do and why?

Fix N+1 queries when selecting accessLevelDescription

Example graphql query

query ($path: ID!) {
  project(fullPath: $path) {
    branchRules(first: 1) {
      nodes {
        branchProtection {
          pushAccessLevels {
            nodes {
              deployKey {
                id
                title
                expiresAt
                user {
                  id
                  username
                  name
                  publicEmail
                  avatarUrl
                  webUrl
                  webPath
                }
              }
              accessLevel
              accessLevelDescription
              user {
                id
                username
                name
                publicEmail
                avatarUrl
                webUrl
                webPath
              }
              group {
                id
                name
                webUrl
                avatarUrl
                parent {
                  id
                  name
                  webUrl
                  avatarUrl
                }
              }
            }
          }
        }
      }
    }
  }
}

Related to #470611

Edited by Jerry Seto

Merge request reports