Skip to content

Extend graphql repository with paginated tree field

What does this MR do?

Contributes to #334140 (closed)

Based on the spike - !65628 (closed) (kudos to @stanhu)

This MR adds a new field paginatedTree to GraphQL request for repository. It returns max 100 elements of trees, blobs and submodules elements and a cursor to the next page. We can provide the cursor to the next request (ex. paginatedTree(after: "<cursor>")) and will return next 100 elements.

GraphQL example

query {
  project(fullPath:"root/my-awesome-project") {
    repository {
      paginatedTree {
        pageInfo {
          endCursor
          startCursor
        }
        nodes {
          submodules {
            nodes {
              path
            }
          }
          trees {
            nodes {
              path
            }
          }
          blobs {
            edges {
              node {
                path
              }
            }
          }
        }
      }
    }
  }
}

Screenshots or Screencasts (strongly suggested)

Screenshot_2021-07-26_at_16.34.00

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

Does this MR contain changes to processing or storing of credentials or tokens, authorization and authentication methods or other items described in the security review guidelines? If not, then delete this Security section.

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by Vasilii Iakliushin

Merge request reports