# graphql-kotlin

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

Martin Brehovsky

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


11/16/2020, 6:22 PM
I made a few tests with graphql-kotlin and Studio a few days ago: This is "live" schema reporting at server startup but if you start your server for tests, it could also run in CI 🙃

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 …)

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