Skip to content

Instantly share code, notes, and snippets.

@mayrop
Last active January 27, 2022 19:43
Show Gist options
  • Save mayrop/2b739932a1ddb1c967c77c456a567d2d to your computer and use it in GitHub Desktop.
Save mayrop/2b739932a1ddb1c967c77c456a567d2d to your computer and use it in GitHub Desktop.

Endpoint: https://api.github.com/graphql Authentication: Bearer {token}

query ($number_of_repos: Int!) {
  viewer {
    name
    repositories(last: $number_of_repos) {
      nodes {
        name
        isPrivate
        owner {
          login
        }
      }
    }
  }
}

{
   "number_of_repos": 3
}

{
  search(query: "org:org is:pr created:{before}..{after}", type: ISSUE, first: 100, after: "{}") {
    codeCount
    issueCount
    pageInfo {
      hasNextPage
      hasPreviousPage
      startCursor
      endCursor
    }
    edges {
      cursor
      node {
        ... on PullRequest {
          repo: repository {
            name
            defaultBranchRef {
              name
            }
          }
          number
          baseRefName
          headRefName
          title
          author: author {
            login
          }
          mergedBy: mergedBy {
            login
          }
          commits: commits {
            totalCount
          }
          comments: comments {
            totalCount
          }
          additions
          changedFiles
          deletions
          state
          merged
          createdAt
          updatedAt
          closedAt
          mergedAt
        }
      }
    }
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment