Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Github apiv4 GraphQL #19

Open
floatas opened this issue Nov 16, 2018 · 3 comments
Open

Github apiv4 GraphQL #19

floatas opened this issue Nov 16, 2018 · 3 comments

Comments

@floatas
Copy link

floatas commented Nov 16, 2018

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.

https://developer.github.com/v4/

@techgaun
Copy link
Owner

Great point @floatas if anyone more familiar with the GraphQL based API has any suggestion, feel free to give some insights. I will take a look at this as well sometimes this weekend. Thanks @floatas

@NJannasch
Copy link

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
Copy link
Owner

techgaun commented Apr 7, 2019

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
        }
      }
    }
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants