Skip to content

Commit 37e7a53

Browse files
author
Bryan Cross
authored
Merge pull request #167 from github/add-graphql-samples
Adding additional queries
2 parents 0086521 + 3c98caf commit 37e7a53

File tree

3 files changed

+74
-0
lines changed

3 files changed

+74
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
query getMembersByTeam($orgName: String!, $teamName: String!) {
2+
organization(login: $orgName) {
3+
id
4+
name
5+
teams(first: 1, query: $teamName) {
6+
edges {
7+
node {
8+
id
9+
name
10+
members(first: 100) {
11+
edges {
12+
node {
13+
id: databaseId
14+
name
15+
}
16+
}
17+
pageInfo {
18+
endCursor #use this value to paginate through teams with more than 100 members
19+
}
20+
}
21+
}
22+
}
23+
}
24+
}
25+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
query getRepoMergedPRDetails($orgName: String!, $repoName: String!) {
2+
repository(owner: $orgName, name: $repoName) {
3+
pullRequests(first: 100, states: MERGED) {
4+
pageInfo {
5+
endCursor #use this value in the pullRequests argument list
6+
#to paginate to the next page using the `after:` argument.
7+
#Use the `before:` argument with this value to specify the previous page
8+
}
9+
edges {
10+
node {
11+
mergedFrom: headRefName
12+
mergedTo: baseRefName
13+
labels(first: 10) {
14+
nodes {
15+
name
16+
}
17+
}
18+
mergeCommit {
19+
message
20+
author {
21+
name
22+
email
23+
}
24+
additions
25+
deletions
26+
}
27+
}
28+
}
29+
}
30+
}
31+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
query getExistingRepoBranches($orgName: String!, $repoName: String!) {
2+
organization(login: $orgName) {
3+
repository(name: $repoName) {
4+
id
5+
name
6+
refs(refPrefix: "refs/heads/", first: 10) {
7+
edges {
8+
node {
9+
branchName:name
10+
}
11+
}
12+
pageInfo {
13+
endCursor #use this value to paginate through repos with more than 100 branches
14+
}
15+
}
16+
}
17+
}
18+
}

0 commit comments

Comments
 (0)