Github apiv4 GraphQL
Opened this issue · 3 comments
floatas commented
Hey,
Not sure if this is issue, maybe question\suggestion. Looks like github will add GraphQL support to their api. Using it would solve probably all current issues, you could make one query and get all required data, maybe pagination would work, maybe sorting works. Haven't looked much in what is supported, but I think this should be reviewed, maybe it's possible to migrate.
techgaun commented
NJannasch commented
An example schema would be:
{
repository(owner: "techgaun", name: "github-dorks") {
id
forks(first: 10, orderBy: {field: UPDATED_AT, direction: DESC}) {
edges {
node {
id
name
diskUsage
owner {
login
}
forkCount
issues {
totalCount
}
watchers {
totalCount
}
stargazers {
totalCount
}
updatedAt
}
}
}
}
}
techgaun commented
Here's the schema we can use and is based off what @NJannasch posted above but includes the repository we are looking at as well (& can be used to close #21 ):
{
repository(owner: "techgaun", name: "github-dorks") {
id
name
defaultBranchRef {
id
name
}
diskUsage
owner {
login
}
forkCount
issues(states: [OPEN]) {
totalCount
}
watchers {
totalCount
}
stargazers {
totalCount
}
pushedAt
forks(first: 100, orderBy: {field: STARGAZERS, direction: DESC}) {
edges {
node {
id
name
diskUsage
defaultBranchRef {
id
name
}
owner {
login
}
forkCount
issues(states: [OPEN]) {
totalCount
}
watchers {
totalCount
}
stargazers {
totalCount
}
pushedAt
}
}
}
}
}