Add achievements plugin (#182)
This commit is contained in:
95
source/plugins/achievements/queries/achievements.graphql
Normal file
95
source/plugins/achievements/queries/achievements.graphql
Normal 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
|
||||
}
|
||||
}
|
||||
}
|
||||
8
source/plugins/achievements/queries/metrics.graphql
Normal file
8
source/plugins/achievements/queries/metrics.graphql
Normal file
@@ -0,0 +1,8 @@
|
||||
query AchievementsMetrics {
|
||||
repository(owner: "lowlighter", name: "metrics") {
|
||||
viewerHasStarred
|
||||
}
|
||||
viewer {
|
||||
login
|
||||
}
|
||||
}
|
||||
8
source/plugins/achievements/queries/octocat.graphql
Normal file
8
source/plugins/achievements/queries/octocat.graphql
Normal file
@@ -0,0 +1,8 @@
|
||||
query AchievementsOctocat {
|
||||
user(login: "octocat") {
|
||||
viewerIsFollowing
|
||||
}
|
||||
viewer {
|
||||
login
|
||||
}
|
||||
}
|
||||
14
source/plugins/achievements/queries/ranking.graphql
Normal file
14
source/plugins/achievements/queries/ranking.graphql
Normal 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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user