github api queries revised and refactored

This commit is contained in:
pseusys
2023-03-11 22:14:21 +01:00
parent 04ff14615b
commit 559b68bd8b
5 changed files with 67 additions and 59 deletions

View File

@@ -18,11 +18,15 @@ GITHUB_API_QUERIES = {
user(login: "$username") {
repositoriesContributedTo(orderBy: {field: CREATED_AT, direction: DESC}, $pagination, includeUserRepositories: true) {
nodes {
isFork
primaryLanguage {
name
}
name
owner {
login
}
isPrivate
isFork
}
pageInfo {
endCursor
@@ -30,28 +34,6 @@ GITHUB_API_QUERIES = {
}
}
}
}""",
# Query to collect info about all commits in user repositories, including: commit date.
# NB! Query includes information about repositories owned by user only.
"repo_committed_dates": """
{
repository(owner: "$owner", name: "$name") {
defaultBranchRef {
target {
... on Commit {
history($pagination, author: { id: "$id" }) {
nodes {
committedDate
}
pageInfo {
endCursor
hasNextPage
}
}
}
}
}
}
}""",
# Query to collect info about all repositories user created or collaborated on, including: name, primary language and owner login.
# NB! Query doesn't include information about repositories user contributed to via pull requests.
@@ -106,6 +88,7 @@ GITHUB_API_QUERIES = {
additions
deletions
committedDate
oid
}
}
pageInfo {
@@ -119,6 +102,7 @@ GITHUB_API_QUERIES = {
}
}
""",
# Query to hide outdated PR comment.
"hide_outdated_comment": """
mutation {
minimizeComment(input: {classifier: OUTDATED, subjectId: "$id"}) {