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

Martin Brehovsky

11/14/2020, 2:37 AM
Is there any recommendation when it comes to publishing the schema? I’m running kotlin-graphql in spring and I’m wondering what would be the best way to integrate the schema exposed by this service with Apollo Studio? Pretty much what I’m looking for is an ability to generate the schema to a file and then upload it to Apollo Studio. Ideally all this happening in our CI build ..
you definitely can create custom plugin/task that will just run schema generator and print out the schema to a file but there is no generic solution atm
m

Martin Brehovsky

11/16/2020, 6:12 PM
ok, thanks for sharing this
m

mbonnin

11/16/2020, 6:22 PM
I made a few tests with graphql-kotlin and Studio a few days ago: https://github.com/martinbonnin/apollo-android-samples/commit/932b9f6d379caa5d03fea4993cc6cf32f17f7b8c This is "live" schema reporting at server startup but if you start your server for tests, it could also run in CI 🙃
m

Martin Brehovsky

11/16/2020, 8:51 PM
Thanks for sharing this. Looking at the code - you seem to be running the full spring boot server in order to extract the schema. I wonder if it would be possible to extract the schema without loading spring boot, but simply by scanning the compiled classes (pretty much looking to extract this as a gradle task …)
d

Dariusz Kuc

11/16/2020, 9:02 PM
yes it is doable -> you just have to implement a mechanism (or hard code a list) to find out your queries, create an instance of hooks (if using custom one) and then just run schema generator
3 Views