Commit ab70f158 authored by Nick Gaskill's avatar Nick Gaskill

Merge branch '339804-aqualls-old-master' into 'master'

Add GraphQL queries about default branches

See merge request gitlab-org/gitlab!69385
parents f20bc457 3b2f84af
...@@ -196,3 +196,32 @@ To fix the problem: ...@@ -196,3 +196,32 @@ To fix the problem:
``` ```
1. In GitLab, [change the default branch](#change-the-default-branch-name-for-a-project) to the one you intend to use. 1. In GitLab, [change the default branch](#change-the-default-branch-name-for-a-project) to the one you intend to use.
### Query GraphQL for default branches
You can use a [GraphQL query](../../../../api/graphql/index.md)
to retrieve the default branches for all projects in a group.
To return all projects in a single page of results, replace `GROUPNAME` with the
full path to your group. GitLab returns the first page of results. If `hasNextPage`
is `true`, you can request the next page by replacing the `null` in `after: null`
with the value of `endCursor`:
```graphql
{
group(fullPath: "GROUPNAME") {
projects(after: null) {
pageInfo {
hasNextPage
endCursor
}
nodes {
name
repository {
rootRef
}
}
}
}
}
```
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment