How to list all files in a repository?


#1

Hello. I want to build a tree view from git repository tree, but can’t figure out how to get it recursively.

{
  repository(owner: "javaparser", name: "javaparser") {
    defaultBranchRef {
      target {
        ... on Commit {
          tree {
            entries {
              name
              mode
              type
            }
          }
        }
      }
    }
  }
}

returns only root.


Reading Repository Contents
#2

I’m using something like

{
  viewer {
    repository(name: "humla") {
      object(expression: "master:") {
      ... on Tree{
        entries{
          name
          type
          mode
        }
      }
    }
    }
  }
}

but there seems to be no way to use it with paging control? Or am I wrong?


#3

@ladariha - your code still only shows the top (current) level… for instance if there is a Tree at that level, it won’t go look in the Tree & return its contents as well; and if that Tree has Trees, then it won’t follow them either. I think what @Bellski and myself are looking for is for it to return both the top (current) level, but also all subTrees & their subTrees, etc.