Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
3b2f84af
Commit
3b2f84af
authored
Oct 08, 2021
by
Amy Qualls
Committed by
Nick Gaskill
Oct 08, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add GraphQL queries about default branches
parent
f20bc457
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
0 deletions
+29
-0
doc/user/project/repository/branches/default.md
doc/user/project/repository/branches/default.md
+29
-0
No files found.
doc/user/project/repository/branches/default.md
View file @
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
}
}
}
}
}
```
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment