Skip to content

Instantly share code, notes, and snippets.

@viktorbezdek
Created January 10, 2023 07:42
Show Gist options
  • Save viktorbezdek/25f26e881b8806cc7ed25ba17531f178 to your computer and use it in GitHub Desktop.
Save viktorbezdek/25f26e881b8806cc7ed25ba17531f178 to your computer and use it in GitHub Desktop.
Github GraphQL API queries
query OrgTeams($org: String!) {
organization(login: $org) {
teams(first: 100) {
pageInfo {
endCursor
hasNextPage
}
nodes {
name
}
}
}
}
query UserOrgTeams($user: String!, $org: String!) {
user(login: $user) {
organization(login:$org) {
teams(first:50, userLogins: [$user]) {
nodes {
name
}
}
}
}
}
query UserPullRequests($user: String!) {
user(login: $user) {
pullRequests(first: 50, orderBy: {field: CREATED_AT, direction: DESC}) {
totalCount
edges {
cursor
node {
state
createdAt
repository {
name
}
mergedAt
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment