|
1 | 1 | ---
|
2 |
| -id: graphql-java-comparison |
3 |
| -title: GraphQL Java Comparison |
| 2 | +id: framework-comparison |
| 3 | +title: GraphQL Frameworks Comparison |
4 | 4 | ---
|
| 5 | + |
| 6 | +## GraphQL Java |
5 | 7 | [graphql-java](https://graphql-java.com/) is one of the most popular JVM based GraphQL implemenations. GraphQL Kotlin is
|
6 | 8 | built on top of `grahpql-java` as it can be easily extended with additional functionality and this implementation
|
7 | 9 | has been used and tested by many users.
|
@@ -134,3 +136,33 @@ val schema: GraphQLSchema = toSchema(config, queries)
|
134 | 136 | ```
|
135 | 137 |
|
136 | 138 | This makes changes in code directly reflect to your schema and you can still produce the `GraphQLSchema` to print and export an SDL file.
|
| 139 | + |
| 140 | + |
| 141 | +## DGS |
| 142 | +[DGS](https://netflix.github.io/dgs/) is a GraphQL server framework for Spring Boot. It works with both Java and Kotlin. |
| 143 | +DGS is also built on top of `graphql-java` and implements many similar features to `graphql-kotlin` and [graphql-java-kickstart/graphql-spring-boot](https://github.com/graphql-java-kickstart/graphql-spring-boot). |
| 144 | + |
| 145 | +* Auto-configuration of server routes and request handling |
| 146 | +* Auto-wiring of data fetchers (resolvers) to the `GraphQLSchema` |
| 147 | +* Apollo Federation support |
| 148 | +* Subscriptions support |
| 149 | +* Client schema-code generation |
| 150 | + |
| 151 | +While both libraries do very similar things, there are some minor differences which may serve different usecases better. |
| 152 | +As with open source library, you can compare and use the right tool for the job. |
| 153 | + |
| 154 | +### Extra Features of DGS |
| 155 | + |
| 156 | +* Support for a SDL-First (Schema-First) approach |
| 157 | +* Ability to autogenerate code stubs from the schema |
| 158 | +* Includes [JsonPath](https://github.com/json-path/JsonPath) testing library |
| 159 | +* Build on top of Spring MVC |
| 160 | + |
| 161 | +### Extra Features of graphql-kotlin |
| 162 | + |
| 163 | +* Supports code-first approach (generates schema from source code - does not require duplicate implementation of data fetchers, schema classes, and SDL files) |
| 164 | +* Abstract server logic can be used in any framework, e.g. Ktor |
| 165 | +* Reference server implementation build on top of [Spring Webflux]((https://spring.io/reactive) for a reactive server stack |
| 166 | +* Simple nesting of data fetchers |
| 167 | +* Client code generation for Ktor and Spring |
| 168 | +* Client plugin support for both Maven and Gradle |
0 commit comments