1

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.

4
  • I don't understand what you're asking... Are you looking to replicate GitHub' schema in graphql-java? Or are you looking for a client library to consume GitHub API? Commented Mar 16, 2018 at 17:27
  • I would like to use GitHub API V4 from Java and was assuming graphql-java could be a useable tool for that. For the time being I am completly lost since the docs are mostly greek (or maybe ancient egypt) to me. Commented Mar 16, 2018 at 17:43
  • Not sure why, but literally no one seems to use the word client when looking for a client... Anyway, see my answer for options Commented Mar 16, 2018 at 17:50
  • -java means client in the java world. -server means server. Commented Mar 16, 2018 at 17:58

2 Answers 2

1

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.

Sign up to request clarification or add additional context in comments.

3 Comments

Thank you for pointing this out. In fact I'd like to avoid any compiled/static code at all.
@WolfgangFahl I'm confused. You're then looking for a generic HTTP client? You send a query via HTTP and get JSON back.
See github.com/BITPlan/com.bitplan.simplegraph/blob/master/… - the JsonSystem can do this already. I need the option to adapt to a specific schema now in creating the queries.
1

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.