graphql-kotlin Kotlin GraphQL开发库

GraphQL 的 Kotlin 生态里,graphql-kotlin算是比较全能的一套库了。它覆盖了客户端、服务器、代码生成这些常见场景,关键是整合得还挺舒服,配合 Spring Boot 或者 Ktor 都能玩得转。

graphql-kotlin的客户端模块挺轻巧的,基于 Ktor 或 Spring WebClient,响应也快,写起来比较顺手。你要是做的是微服务架构,像 Apollo Federation 那种联合查询,它也了专门的支持,扩展性还不错。

它走的是代码优先模式,也就是说你直接写 Kotlin 类就能生成 GraphQL schema,不用先定义 SDL 那一套。对 Kotlin 开发者来说,这个开发流程会自然多。

你如果在用 Gradle 或 Maven,它也有插件可以直接集成,构建配置不麻烦。测试用例方面,它还有个示例应用可以参考,适合刚上手的时候看一下。

如果你想深入了解,推荐看下这几个文章:GraphQL-Ktor 结合用法,还有自动生成 Kotlin 代码那篇,对实际开发蛮有。

嗯,总体来说,graphql-kotlin适合做 Kotlin 项目的 GraphQL 方案。如果你项目刚好用 Kotlin,又想试试 GraphQL,可以优先考虑它。

folder
graphql-kotlin:在Kotlin中运行GraphQL的库 预估大小:896个文件
file
gradlew.bat 3KB
file
gradlew 6KB
file
testSchema.graphql 4KB
file
schema.graphql 4KB
file
schema.graphql 3KB
file
testSchema.graphql 4KB
file
schema.graphql 3KB
file
mvnw.cmd 6KB
file
spring.factories 127B
file
custom.css 297B
file
.gitignore 55B
file
ExampleQuery.graphql 957B
file
mvnw.cmd 6KB
file
schema.graphql 5KB
file
gradlew.bat 3KB
file
application.conf 194B
file
gradlew 6KB
file
.gitignore 93B
file
.gitignore 383B
file
.editorconfig 515B
zip 文件大小:1.83MB