Is there any recommendation when it comes to publi...
# graphql-kotlin
m
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
ok, thanks for sharing this
m
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
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
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