https://github.com/lsqy/taro-github-rank
a application for github rank
https://github.com/lsqy/taro-github-rank
Last synced: 3 months ago
JSON representation
a application for github rank
- Host: GitHub
- URL: https://github.com/lsqy/taro-github-rank
- Owner: lsqy
- License: mit
- Created: 2019-08-05T11:12:12.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-11T00:49:52.000Z (over 2 years ago)
- Last Synced: 2024-12-30T20:21:52.119Z (5 months ago)
- Language: TypeScript
- Size: 1.08 MB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 18
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## taro-github-rank
> 为了方便地查看github当前最受关注的人和仓库
### GraphQL请求示例
> Connections是可以进行检索的
#### 仓库相关信息
```
query {
repository(owner:"lsqy", name:"taro-music") {
forkCount,
description,
createdAt,
stargazers {
totalCount
},
issues(orderBy:{field: UPDATED_AT, direction: DESC} , labels: null, first: 10) {
edges{
cursor
node{
title
updatedAt
number
}
}
}
labels(first: 20){
nodes{
name
}
}
}
}```
#### 用户相关信息
> 逐步将所有可以请求到的信息显示出来
```
query {
user(login: "lsqy") {
name,
websiteUrl,
location,
isHireable,
location,
createdAt,
databaseId,
email,
organization(login: "NervJS") {
name,
location
},
pinnedItemsRemaining,
projectsResourcePath,
projectsUrl,
repository(name: "taro-music"){
stargazers {
totalCount
}
},
resourcePath,
status {
message
},
updatedAt,
url,
viewerCanChangePinnedItems,
viewerCanCreateProjects,
viewerCanFollow,
viewerIsFollowing,
bio,
commitComments(first: 30) {
edges {
cursor,
node {
body,
url,
viewerDidAuthor,
author {
avatarUrl,
login,
resourcePath,
url
}
}
},
totalCount
},
followers(first: 10) {
edges{
cursor,
node {
login,
name,
email,
websiteUrl,
url,
location,
isHireable,
viewerIsFollowing,
bio,
}
},
pageInfo {
endCursor,
hasNextPage,
hasPreviousPage,
startCursor
},
totalCount
}
}
}```
- 中国top50最受关注
```
query {
search(query:"location:China", type: USER, first: 50, after: null) {
edges{
cursor
node{
... on User {
name,
email,
websiteUrl,
url,
location,
isHireable,
viewerIsFollowing,
bio,
followers(first: 10) {
edges{
cursor
node {
login
}
},
nodes {
login
},
pageInfo {
endCursor,
hasNextPage,
hasPreviousPage,
startCursor
},
totalCount
}
}
}
}
}
}
```### 参考文章
- [通过 Github V4 API 来了解 GraphQL](https://hiberabyss.github.io/2018/05/22/graphql-introduction-via-github-api/)