diff options
author | Phil Hughes <me@iamphill.com> | 2019-05-24 12:39:18 +0300 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2019-05-24 15:58:11 +0300 |
commit | d8bb8d458c09146d70261026a5c90e97903b99c4 (patch) | |
tree | 5403eb594816cf2010aa213d1446d1fa871a6a4a /app/assets/javascripts/repository/queries/getFiles.graphql | |
parent | c509b35b489ff69121c4760faa52d81e7666e9ca (diff) |
Pull files for repository tree from GraphQL API
Diffstat (limited to 'app/assets/javascripts/repository/queries/getFiles.graphql')
-rw-r--r-- | app/assets/javascripts/repository/queries/getFiles.graphql | 58 |
1 files changed, 53 insertions, 5 deletions
diff --git a/app/assets/javascripts/repository/queries/getFiles.graphql b/app/assets/javascripts/repository/queries/getFiles.graphql index fb446780ed1..a9b61d28560 100644 --- a/app/assets/javascripts/repository/queries/getFiles.graphql +++ b/app/assets/javascripts/repository/queries/getFiles.graphql @@ -1,7 +1,55 @@ -query getFiles($path: String!, $ref: String!) { - files(path: $path, ref: $ref) @client { - id - flatPath - type +fragment TreeEntry on Entry { + id + flatPath + type +} + +fragment PageInfo on PageInfo { + hasNextPage + endCursor +} + +query getFiles( + $projectPath: ID! + $path: String + $ref: String! + $pageSize: Int! + $nextPageCursor: String +) { + project(fullPath: $projectPath) { + repository { + tree(path: $path, ref: $ref) { + trees(first: $pageSize, after: $nextPageCursor) { + edges { + node { + ...TreeEntry + } + } + pageInfo { + ...PageInfo + } + } + submodules(first: $pageSize, after: $nextPageCursor) { + edges { + node { + ...TreeEntry + } + } + pageInfo { + ...PageInfo + } + } + blobs(first: $pageSize, after: $nextPageCursor) { + edges { + node { + ...TreeEntry + } + } + pageInfo { + ...PageInfo + } + } + } + } } } |