简体   繁体   English

使用某些GraphQL Java库(如果有)的带有Java的GitHub V4 GraphQL API

[英]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. 对于API的V3版本,我在Stackoverflow上发现了很多问题。 There are also libraries available at https://developer.github.com/v3/libraries/ . 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 我宁愿使用V4 api,因为我打算为simplegraph开源项目进行集成,请参见https://github.com/BITPlan/com.bitplan.simplegraph/issues/5

For the V4 API i found the following links so far: 到目前为止,对于V4 API,我发现了以下链接:

It looks as a starting point a Schema definition like this one: 它看起来像这样的Schema定义作为起点:

would be helpful. 会有所帮助。

Where can I get souch a graphql-java useable schema definition of the github V4 api? 我在哪里可以得到github V4 api的graphql-java可用模式定义?

Would it be possible to somehow create this from the Json response of the 是否可以通过Json的响应以某种方式创建它

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

query? 查询?

At http://wiki.bitplan.com/index.php/GitHub-GraphQL I am documenting my next steps. http://wiki.bitplan.com/index.php/GitHub-GraphQL上,我正在记录我的后续步骤。

You're looking at the wrong tool then. 您正在寻找错误的工具。 graphql-java is an implementation of the GraphQL spec. graphql-java是GraphQL规范的实现。 It's used for developing GraphQL servers in Java. 它用于用Java开发GraphQL服务器。

What you're looking for is a client. 您正在寻找的是客户。 There's currently only 2 available, neither great but likely usable. 当前只有2个可用,既不好用又可能可用。

  • Apollo Android - Don't let the name throw you off, it's perfectly usable from normal Java Apollo Android-不要忘了名称,它可以从常规Java完全使用

  • Shopify's Java gen - Generates a Java client from the given schema, similar to wsdl2java. Shopify的Java gen-从类似于wsdl2java的给定架构生成Java客户端。 Requires Ruby. 需要Ruby。

Here: https://github.com/octokit/graphql-schema/blob/master/schema.graphql is the GitHub v4 API schema. 此处: https : //github.com/octokit/graphql-schema/blob/master/schema.graphql是GitHub v4 API模式。 You can use this schema with graphql-java library. 您可以将此模式与graphql-java库一起使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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