https://kotlinlang.org logo
#graphql-kotlin
Title
# graphql-kotlin
d

dany giguere

03/12/2024, 10:56 PM
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

Arivnd Ramesh

03/12/2024, 11:00 PM
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

Shane Myrick

03/13/2024, 12:30 AM
d

Dariusz Kuc

03/13/2024, 4:28 PM
*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

dany giguere

03/13/2024, 4:57 PM
Thank you all for the good information. I’ll start looking into tonight, after my shift :)
d

Dariusz Kuc

03/13/2024, 4:58 PM
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

dany giguere

03/13/2024, 11:14 PM
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

hantsy

04/07/2024, 12:25 PM
👍 1
2 Views