问题
I am looking for a java client library for GraphQL. This is to use for server-to-server communication, both in java. No android, not javascript... just java. Apollo is the nearest answer, and it seems like it is for Android only, not for plain-java applications. Lots of examples about build server in java, nothing about client. Any idea? Thanks!
回答1:
There's a few clients available, all taking different approaches.
- Apollo Android - Originally intended for Android, but equally usable in any Java project. Someone also made a Maven plugin for it.
- Shopify's GraphQL Java gen - Similar to what wsdl2java does, for example, but not wrapped into a Maven plugin. Generates a nice client, but requires Ruby... It's worth investigating if the Ruby dependency can be satisfied using JRuby JAR.
- Nodes
- Manifold can be used as a GraphQL client
来源:https://stackoverflow.com/questions/49087643/graphql-java-client-library