Add achievements plugin (#182)

This commit is contained in:
Simon Lecoq
2021-03-12 14:33:07 +01:00
committed by GitHub
parent 161c0bd5bc
commit 7c43e871cd
16 changed files with 728 additions and 1 deletions

View File

@@ -0,0 +1,95 @@
query AchievementsDefault {
user(login: "$login") {
repositories(first: 1, privacy: PUBLIC, affiliations: OWNER, orderBy: {field: CREATED_AT, direction: ASC}) {
nodes {
createdAt
nameWithOwner
}
totalCount
}
forks:repositories(first: 1, privacy: PUBLIC, isFork: true, orderBy: {field: CREATED_AT, direction: ASC}) {
nodes {
createdAt
nameWithOwner
}
totalCount
}
popular:repositories(first:1, orderBy: {field: STARGAZERS, direction: DESC}) {
nodes {
stargazers {
totalCount
}
}
}
pullRequests(orderBy: {field: CREATED_AT, direction: ASC}, first: 1) {
nodes {
createdAt
title
repository {
nameWithOwner
}
}
totalCount
}
contributionsCollection {
pullRequestReviewContributions(first: 1, orderBy: {direction: ASC}) {
nodes {
occurredAt
pullRequest {
title
number
repository {
nameWithOwner
}
}
}
totalCount
}
}
projects(first: 1, orderBy: {field: CREATED_AT, direction: ASC}) {
totalCount
#nodes { This requires additional scopes :/
# name
#}
}
packages(first: 1, orderBy: {direction: ASC, field: CREATED_AT}) {
totalCount
#nodes { This requires additional scopes :/
# name
# packageType
# versions(first: 1, orderBy: {direction: ASC, field: CREATED_AT}) {
# nodes {
# id
# }
# }
#}
}
organizations(first: 1) {
nodes {
name
}
totalCount
}
gists(first: 1, orderBy: {field: CREATED_AT, direction: ASC}) {
nodes {
createdAt
name
}
totalCount
}
starredRepositories {
totalCount
}
followers {
totalCount
}
following {
totalCount
}
bio
status {
message
}
}
}

View File

@@ -0,0 +1,8 @@
query AchievementsMetrics {
repository(owner: "lowlighter", name: "metrics") {
viewerHasStarred
}
viewer {
login
}
}

View File

@@ -0,0 +1,8 @@
query AchievementsOctocat {
user(login: "octocat") {
viewerIsFollowing
}
viewer {
login
}
}

View File

@@ -0,0 +1,14 @@
query AchievementsRanking {
repo_rank:search(query: "stars:>$stars", type: REPOSITORY, first: 0) {
repositoryCount
}
user_rank:search(query: "followers:>$followers", type: USER, first: 0) {
userCount
}
repo_total:search(query: "stars:>-1", type: REPOSITORY, first: 0) {
repositoryCount
}
user_total:search(query: "followers:>-1", type: USER, first: 0) {
userCount
}
}