Skip to content

Instantly share code, notes, and snippets.

@chrisvogt
Last active August 28, 2019 04:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrisvogt/de4fb3de87f4cbda8ec4144d89a822c0 to your computer and use it in GitHub Desktop.
Save chrisvogt/de4fb3de87f4cbda8ec4144d89a822c0 to your computer and use it in GitHub Desktop.
Fetch the last n pull requests for a user from the GitHub GraphQL API.
query {
user(login: "${username}") {
pullRequests(
last: ${maxRepos},
orderBy: {
direction: ASC,
field: CREATED_AT
}
) {
nodes {
additions
bodyText
closed
closedAt
createdAt
mergeCommit {
author {
date,
name,
user {
avatarUrl
url
login
name
}
}
authoredDate
changedFiles
additions
deletions
message
messageHeadline
url
commitUrl
committedDate
}
mergeable
merged
mergedAt
number
repository {
name
nameWithOwner
openGraphImageUrl
url
}
title
updatedAt
url
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment