What is the best graphql library to use with Kotli...
# graphql-kotlin
d
What is the best graphql library to use with Kotlin’s coroutines ? my demo project is here: https://github.com/danygiguere/spring-boot-3-reactive-with-kotlin-coroutines but I use only coroutines with suspend functions like:
Copy code
@GetMapping("/posts/{id}")
suspend fun getById(@PathVariable id: Long): ResponseEntity<PostDto> {
    val response = postService.findById(id)
    return if (response != null) ResponseEntity.ok(response)
    else ResponseEntity.notFound().build()
}
I’d like to convert the project to use GraphQl. (it will be in a different demo of course with a bff and microservices)
a
We use the DGS library. I haven't used other frameworks so I cannot compare it, but we have been pretty happy with it. There are helpful codegen and IDE plugins to make it easy to work with, decent testing features, and it comes with a good amount of metrics and logging out of the box
👍 1
s
d
*as a side note this channel is specifically for
graphql-kotlin
lib, there is a more generic #graphql channel
👍 1
DGS is built on top of SpringBoot so yeah it works with coroutines as well 😉
👍 1
and "official"
spring-graphql
should work as well
👍 1
d
Thank you all for the good information. I’ll start looking into tonight, after my shift :)
d
TLDR is
graphql-kotlin
is code first,
DGS
and
spring-graphql
are SDL first so pick one that better fits your needs
❤️ 1
👍 1
*and all of them are built on top of SpringBoot
👍 1
d
Thank you guys. I’m already set up with DGS. It was very easy !!! and btw it says this on the website:
Copy code
The DGS and Spring-GraphQL teams are super excited to introduce deep integration between the DGS framework and Spring-GraphQL.
so I don’t have to choose btw DGS and spring-graphql now :)
h
👍 1