Skip to content

Instantly share code, notes, and snippets.

@totoroyyb
Created January 8, 2023 07:17
Show Gist options
  • Save totoroyyb/27000f3c17b3c694d1351f980faa7a79 to your computer and use it in GitHub Desktop.
Save totoroyyb/27000f3c17b3c694d1351f980faa7a79 to your computer and use it in GitHub Desktop.
GitHub OSS Governance Documentation Dataset - GraphQL Queries
query GetRepoCommits(
$owner: String!, $name: String!,
$commit_num: Int!, $commit_cursor: String
) {
repository(owner:$owner, name:$name) {
defaultBranchRef {
name
target {
... on Commit {
history(first: $commit_num, after: $commit_cursor) {
pageInfo {
hasNextPage
startCursor
endCursor
}
edges {
node {
... on Commit {
repository {
nameWithOwner
}
author {
name
email
user {
login
}
}
committer {
name
email
user {
login
}
}
authoredByCommitter
messageHeadline
messageBody
oid
abbreviatedOid
additions
deletions
changedFiles
committedDate
pushedDate
commitUrl
}
}
}
}
}
}
}
}
}
query GetRepoIssueComments(
$owner: String!, $name: String!,
$issue_number: Int!, $comment_number: Int!,
$comment_cursor: String
) {
repository(owner:$owner, name: $name) {
issue(number: $issue_number) {
comments(first: $comment_number, after: $comment_cursor) {
pageInfo {
hasNextPage
startCursor
endCursor
}
edges {
node {
issue {
number
url
}
repository {
nameWithOwner
}
author {
login
}
authorAssociation
editor {
login
}
bodyText
createdAt
lastEditedAt
publishedAt
isMinimized
minimizedReason
url
}
}
}
}
}
}
query GetRepoIssues(
$owner: String!, $name: String!,
$issue_num: Int!, $issue_cursor: String,
) {
repository(owner:$owner, name:$name) {
issues(first: $issue_num, after: $issue_cursor) {
pageInfo {
hasNextPage
startCursor
endCursor
}
edges {
node {
repository {
nameWithOwner
}
title
bodyText
url
number
author {
login
}
authorAssociation
comments {
totalCount
}
state
closed
closedAt
createdAt
lastEditedAt
publishedAt
updatedAt
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment