Skip to content

Commit 960f0b1

Browse files
committed
Add query to list organization memberships for a
user Added a GraphQL query to list the organizations a user belongs to on GitHub.com. This query retrieves the organization name and slug for each organization.
1 parent 4fe2f31 commit 960f0b1

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# This GraphQL query can be used to generate a list of organizations a user belongs to on GitHub.com
2+
# replace GITHUB_LOGIN with the username that you would like to view
3+
#
4+
# Note: the organizations listed are only ones that the calling user is a member of. If the calling member is not part of any organizations that the searched user belong to, it will not be shown here.
5+
6+
query GetUserOrganizations {
7+
user(login: "GITHUB_LOGIN") {
8+
organizations(first: 100) {
9+
nodes {
10+
organization_name: name
11+
organization_slug: login
12+
}
13+
}
14+
}
15+
}

0 commit comments

Comments
 (0)