Add your schema requests

schema-request

#1

Update

Over time and quite predictably, schema requests in a single thread have become hard to manage. Additionally, more complex discussions about schema requests or existing schema were often lost or difficult to follow in the larger thread.

As a result, we’re changing how we’d like to receive this type of feedback from the community to make sure we don’t miss anything. Going forward, just create a new topic for your schema request and tag your new topic with schema-request for increased visibility.


As we continue to build our GraphQL API, we’re going to be adding more and more objects to the schema. If you have some objects that you’d like to be added, please add your request to this thread. :ship:

  • Include the data you’d like to have access to
  • Link to existing REST API data if applicable
  • Describe how you plan to use the data

Lookup users by login
Request support for additional endpoints for Integrations
Fetching Issue by its issuenumber
Statistics support?
#2

Hi!

It would be awesome to have something like the repository content API ported to graphQL:

https://developer.github.com/v3/repos/contents/

We use the content api in https://github.com/netlify/netlify-cms but it’s very chatty and consumes all the rate limits very quickly.

Happy to test it a provide feedback.

Cheers,
David


#3

Is there a way to get branch data for a repository, like in the REST API (https://developer.github.com/v3/repos/branches/#list-branches)?

I have some code that gets all our repositories, then reaches into each repository to grab all the branches. I use this branch data to generate a list of deployable applications, which have a predictable naming convention for release branches. This takes dozens of REST calls.

I think a query could look something like this, with the branches connection returning Refs:

{
  repositoryOwner(login:"github") {
    repositories(first: 30) {
      edges {
        node {
          name
          owner {
            login
          }
          branches(first: 30) {
            edges {
              node {
                name
              }
            }
          }
        }
      }
    }
  }
}

I think this would let me query the data as a single, unified structure (if I can figure out the pagination).


#4

Hi, I’d really like to be able to access the labels of a pull request. I’m building a metrics dashboard for my team’s master repo and I’d like to be able to graph the number of open PRs per team. We add the team name as a label on each PR to track who’s working on what.

I think with the REST API because Issues and PRs are linked this works as explained here: https://developer.github.com/v3/issues/labels/#list-labels-on-an-issue

It seems like so far PRs and Issues are not linked in the GraphQL API – the only way I can think of doing it so far is to walk backwards through the Events of a PR and figure out the most recent LabeledEvents but that seems unnecessarily complicated!

Thanks and super cool project :thumbsup:


#5

It would be nice to be able to access gists using GraphQL.


#6

As a follow up to this comment. We might not need write access and mutators directly in graphql. I think having only read access would be enough. The expensive operations are always around retrieving content, specially in big directories.


#7

I’d like to see org membership with the 2fa_disabled filter, as mentioned here: https://developer.github.com/v3/orgs/members/. I need to ping everyone in my org with 2fa disabled and give them “one last chance” to enable it.


2FA information for organization members
#8

Order By specific field you’re query, Something like this:

{
  repositoryOwner(login:"github") {
    repositories(first: 5, orderBy: {field:"node.stargazers.totalCount",direction:DESC}, isFork:false) {
      edges {
        node {
          name
          stargazers {
            totalCount
          }
        }
      }
    }
  }
}

#9

Alternative would be to have access to pinned repositories for the user.

{
  repositoryOwner(login:"jcubic") {
    ... on User {
      pinnedRepositories {
        name
        stargazers {
          totalCount
        }
      }
    }

#10

Hi @kdaigle

Refer to Request support for additional endpoints for Integrations

I want to request an access to Releases data so I can plot comparison graph for released history of each repository via GraphQL.

Thanks


#11

Shipped a User.pinnedRepositories connection just now! Thanks for the suggestion :smiley_cat:


#12

It would be nice to have access to repository languages, I will use this to get tags that user is most active by getting repos that have most stars.


#13

It would be great if we could have access to the logged in user’s notifications. This is currently possible through the REST API by making a request to /notifications (documentation).

Would love to use it with Gitify!


#14

@manosim We definitely plan to add them at some point and we’ll discuss with the team internally, but it may make sense to hold off on notifications through the GraphQL API for now.

As @kdaigle noted in his talk at Universe, we’re looking into a few different options for real-time or possibly streaming data through GraphQL as well as at some point likely supporting subscriptions. It will probably be best to wait until we have that mechanism established before we add notifications to the schema.

@jcubic @katopz great suggestions. :thumbsup:


#15

I’ve been trying the GitHub GraphQL API, which is great. However, I’m trying to get the languages used by each repository for an organization and I’m having trouble getting the organization (could only do it via search) and getting the languages from the Repository type (which appears not to be possible).

Here’s the query I’m running:

query {  
  search(first: 1, query: "Subvisual", type: USER) {
    edges {
      node {
        ... on Organization {
          repositories(first: 10) {
            edges {
              node {
                name
              }
            }
          }
        }
      }
    }
  }
}

Get repository languages
#16

We’re looking into exposes languages used by repositories at the moment. :smile: Hopefully we’ll have something to usable soon.


#17

Awesome! How about getting an organization, is search the only way at the moment?


#18

@zamith You can expect an easier way to do this in the future but, for now, I’d recommend trying the repositoryOwner root field:

query {
  repositoryOwner(login: "github") {
    ... on Organization {
      name
    }
  }
}

#19

I would like to be able to query for information about team members. Specifically, I would like to be able to find all open PRs for a given team (just want to emphasize - for a team, not for an Org). These PRs may be across multiple repos. I would love to have this capability for GitHub proper of course, though really want it for GitHub Enterprise.


#20

We’d love to use the new GraphQL API for git-reflow, but would need access to PullReqest and associated status, build status and Reviews.