GraphQL Java 客户端库 [英] GraphQL Java client library

查看:35
本文介绍了GraphQL Java 客户端库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一个用于 GraphQL 的 Java 客户端 库.这是用于服务器到服务器的通信,均在 java 中.没有android,没有javascript……只有java.Apollo 是最接近的答案,它似乎仅适用于 Android,而不适用于纯 Java 应用程序.很多关于在java中构建服务器的例子,没有关于客户端.任何的想法?谢谢!

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!

推荐答案

有几个客户端可用,它们都采用不同的方法.

There's a few clients available, all taking different approaches.

  1. Apollo Android - 最初用于 Android,但同样适用于任何 Java 项目.有人还为它制作了一个 Maven 插件.
  2. Shopify 的 GraphQL Java gen - 类似于例如,wsdl2java 确实可以,但没有包装到 Maven 插件中.生成一个不错的客户端,但需要 Ruby... 值得研究一下,使用 JRuby JAR 是否可以满足 Ruby 依赖项.
  3. 节点 GraphQL JVM 客户端,旨在根据标准模型定义构建查询.美国运通
  4. Manifold 可用作 GraphQL 客户端
  5. graphql-kotlin GraphQL Kotlin 提供了一组轻量级类型安全的 GraphQL HTTP 客户端.该库提供基于 Ktor HTTP 客户端和 Spring WebClient 的参考实现,并允许使用其他引擎进行自定义实现.类型安全的数据模型由 GraphQL Kotlin Gradle 和 Maven 插件在构建时生成.
  1. Apollo Android - Originally intended for Android, but equally usable in any Java project. Someone also made a Maven plugin for it.
  2. 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.
  3. Nodes A GraphQL JVM Client designed for constructing queries from standard model definitions. By American Express
  4. Manifold can be used as a GraphQL client
  5. graphql-kotlin GraphQL Kotlin provides a set of lightweight type-safe GraphQL HTTP clients. The library provides Ktor HTTP client and Spring WebClient based reference implementations as well as allows for custom implementations using other engines. Type-safe data models are generated at build time by the GraphQL Kotlin Gradle and Maven plugins.

这篇关于GraphQL Java 客户端库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆