简体   繁体   中英

GitHub V4 GraphQL API with Java using some GraphQL Java library (if available)

For the V3 Version of the API I found quite a few questions here on Stackoverflow. There are also libraries available at https://developer.github.com/v3/libraries/ .

I'd rather use the V4 api because I intend to do an integration for the simplegraph open source project see https://github.com/BITPlan/com.bitplan.simplegraph/issues/5

For the V4 API i found the following links so far:

It looks as a starting point a Schema definition like this one:

would be helpful.

Where can I get souch a graphql-java useable schema definition of the github V4 api?

Would it be possible to somehow create this from the Json response of the

query {
  __schema {
    types {
      name
      kind
      description
      fields {
        name
      }
    }
  }
}

query?

At http://wiki.bitplan.com/index.php/GitHub-GraphQL I am documenting my next steps.

You're looking at the wrong tool then. graphql-java is an implementation of the GraphQL spec. It's used for developing GraphQL servers in Java.

What you're looking for is a client. There's currently only 2 available, neither great but likely usable.

  • Apollo Android - Don't let the name throw you off, it's perfectly usable from normal Java

  • Shopify's Java gen - Generates a Java client from the given schema, similar to wsdl2java. Requires Ruby.

Here: https://github.com/octokit/graphql-schema/blob/master/schema.graphql is the GitHub v4 API schema. You can use this schema with graphql-java library.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM