当前位置: 首页 > 软件库 > Web应用开发 > >

graphql-java-tools

授权协议 MIT License
开发语言 Java
所属分类 Web应用开发
软件类型 开源软件
地区 不详
投 递 者 莫泓
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

GraphQL Java Tools

Github Build

This library allows you to use the GraphQL schema language to build your graphql-java schema.Inspired by graphql-tools, it parses the given GraphQL schema and allows you to BYOO (bring your own object) to fill in the implementations.GraphQL Java Tools works well if you already have domain POJOs that hold your data (e.g. for RPC, ORM, REST, etc) by allowing you to map these "magically" to GraphQL objects.

GraphQL Java Tools aims for seamless integration with Java, but works for any JVM language. Try it with Kotlin!

We are looking for contributors!

Are you interested in improving our documentation, working on the codebase, reviewing PRs?

Reach out to us on GitHub and join the team!

Quick start

Using Gradle

Set the Kotlin version in your gradle.properties:

kotlin.version=1.5.0

Add the dependency:

compile 'com.graphql-java-kickstart:graphql-java-tools:12.0.0'

Using Maven

Set the Kotlin version in your <properties> section:

<properties>
    <kotlin.version>1.5.0</kotlin.version>
</properties>

Add the dependency:

<dependency>
    <groupId>com.graphql-java-kickstart</groupId>
    <artifactId>graphql-java-tools</artifactId>
    <version>12.0.0</version>
</dependency>

Documentation

Take a look at our documentation for more details.

Why GraphQL Java Tools?

  • Schema First: GraphQL Java Tools allows you to write your schema in a simple, portable way using the GraphQL schema language instead of hard-to-read builders in code.
  • Minimal Boilerplate: It takes a lot of work to describe your GraphQL-Java objects manually, and quickly becomes unreadable.A few libraries exist to ease the boilerplate pain, including GraphQL-Java's built-in schema-first wiring, but none (so far) do type and datafetcher discovery.
  • Stateful Data Fetchers: If you're using an IOC container (like Spring), it's hard to wire up datafetchers that make use of beans you've already defined without a bunch of fragile configuration. GraphQL Java Tools allows you to register "Resolvers" for any type that can bring state along and use that to resolve fields.
  • Generated DataFetchers: GraphQL Java Tools automatically creates data fetchers for your fields that call the appropriate method on your java class. This means all you have to do to create a new field is add the field definition to your schema and add a corresponding method on your class.
  • Type->Class Discovery: GraphQL Java Tools starts from your root objects (Query, Mutation) and, as it's generating data fetchers for you, starts to learn about the classes you use for a certain GraphQL type.
  • Class Validation: Since there aren't any compile-time checks of the type->class relationship, GraphQL Java Tools will warn you if you provide classes/types that you don't need to, as well as erroring if you use the wrong Java class for a certain GraphQL type when it builds the schema.
  • Unit Testing: Since your GraphQL schema is independent of your data model, this makes your classes simple and extremely testable.

Known Issues

Known issues are aggregated at the wiki.

  • 介绍: GraphQL 是 API 的查询语言,也是对数据执行查询的运行时。它提供了一种比传统 REST API 更高效、更强大、更灵活的替代方案。在本教程中,我们将学习如何将 GraphQL 与 Spring Boot 集成并构建一个简单的应用程序。我们将使用 Java、Spring Boot 和 graphql-java 库来创建我们的应用程序。 先决条件: 在我们开始之前,请确保您的系统上安

  • 开门见山,谈一谈我这一个星期的对GraphQL的认识: Schema定义的理解 刚开始认为,暴露给外部的API类似Java类中的方法,忽视了其实API和自定义类在GraphQL中都是自定义Type。而对方法的定义其实都是对字段的定义,类似Pojo中的属性。 1 2 3 4 5 6 7 8 9 10 11 12 schema { query: userQuery } type userQue

  • graphql 入门介绍 https://blog.csdn.net/z69183787/article/details/86759767 引入springboot相应jar包,这里指指明使用的graphql相关jar包 <!-- graphql --> <dependency> <groupId>com.graphql-java</groupId> <artifactId>gra

  • 因为自己写过基于react的前端应用,因此一看到GraphQL就被深深吸引,真是直击痛点啊! 服务端开发一直是基于java, Spring的,因此开始研究如何在现有工程框架下加入graphql的支持。 本文属于随笔性质,学到哪里,用到哪里,就写到哪里,观点为个人理解,仅供参考。 GraphQL基本概念 Schema: 指一个特定GraphQL类型系统的定义,也指具体的包含类型系统定义的文本文件。在

 相关资料
  • graphql-java 是 GraphQL 的 Java 实现。这个库的目标是用于真实的生产环境。 graphql-java 解析和执行查询 GraphQL 。它并不真正获取任何数据的:数据来源于执行回调或提供静态数据。 graphql-java 的 "hello world": import graphql.schema.GraphQLObjectType;import graphql.sch

  • 我是graphql新手,使用官方graphql发现了2个java实现:https://www.graphql-java.com/documentation/v10/ 和 https://github.com/graphql-java-kickstart/graphql-java-tools 比如在java中实现graphql有什么不同?

  • 问题内容: 目前,在graphql-java库中看不到分页的现有支持。它确实具有一些基本的中继支持,在其中,我们可以创建Facebook推荐的实现分页的方式。 这是有助于实现该目标的方法。但是,由于没有文档,因此很难理解此功能的工作原理。可有人击穿的步骤,他们将采取添加分页支持,如果他们已经有一个现成的模式,它允许像基本的查询,,等使用graphql- Java库? 问题答案: 您甚至不需要中继连

  • 我正试图在我的项目中禁用< code>GraphQL内省,但在我使用的特定框架上运气不佳。有些文章说它可以在< code>CcodeRegistry模块中完成,但那是一个只读的反编译源代码。有人用< code > graph QL-Java-kickstart 框架实现了这一点吗? 以下是我的pom文件中的依赖项:

  • 问题内容: 我正在寻找GraphQL 的Java 客户端 库。两者均用于Java中的服务器到服务器通信。没有android,没有javascript …只是java。Apollo是最接近的答案,似乎仅适用于Android,而不适用于纯Java应用程序。有很多关于用Java构建服务器的例子,没有关于客户端的例子。任何想法?谢谢! 问题答案: 有几个可用的客户,都采用不同的方法。 Apollo And