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

dave08

02/17/2021, 9:15 AM
Hi! Does the graphql client run on kotlin js? We're thinking of using it in a Kotlin React frontend.
I guess not... there seems to be java dependencies in the GraphqlKtorClient... even though potentially it might have been possible since Ktor is multiplatform.
d

Dariusz Kuc

02/17/2021, 12:50 PM
Currently it is JVM only with hard Jackson dependency
I'm in a process of updating it to allow use of kotlinx serialization which could then allow us to publish it as multiplatform
👍🏼 1
d

dave08

02/17/2021, 12:52 PM
What do you currently do for frontend js requests?
d

Dariusz Kuc

02/17/2021, 12:53 PM
JS has number of options but we use Apollo
d

dave08

02/17/2021, 12:53 PM
With Kotlin JS?
d

Dariusz Kuc

02/17/2021, 12:53 PM
We dont use Kotlin JS
d

dave08

02/17/2021, 12:54 PM
Also, I found the issue in the repo about Micronaut support, but it seems things changed a bit... would it be hard to integrate it?
m

mbonnin

02/17/2021, 12:56 PM
Apollo Android does codegen for kotlin JS if you don't mind sending over http by yourself.
d

Dariusz Kuc

02/17/2021, 12:56 PM
Please raise an issue - as for the "official" server support I'm not sure if we'll support it
With the recent refactoring it should be rather simple creating different servers (as shown in ktor example)
d

dave08

02/17/2021, 12:57 PM
We currently have a bunch of Microservices running on Micronaut, and we can't easily switch frameworks... and using graphql-java alone (that has support in Micronaut), is SO much harder! Is the setup much different than this: https://github.com/ExpediaGroup/graphql-kotlin/issues/506#issuecomment-563272178
I tried it but it seems like the GraphQLContextBuilder doesn't seem to exist... and it pulls tons of spring deps that I'm not sure I need...
@mbonnin Thanks! I'll take a look.
👍 1
d

Dariusz Kuc

02/17/2021, 1:00 PM
Since we updated a lot since then I'd assume a lot of things changed - havent tried it recently
Take a look at new graphql server package that provides the abstraction - it should not have any spring dependencies
*in 4.0.0 versions
d

dave08

02/17/2021, 1:02 PM
Thanks, I'll take a look.
2 Views