Hey. There is information on multi module configur...
# apollo-kotlin
a
Hey. There is information on multi module configuration for sharing schema. Is there any information about making a schema repo and using the same artifact in multiple projects? Is that not a recommended approach?
m
Hi đź‘‹ It's pretty new but it is supported. See https://github.com/apollographql/apollo-kotlin/pull/3904
🤩 1
Hard to tell how "recommended" this is. I don't see a reason not to do it. It could definitely help some codebases
You'd certainly be one of the very first to try it on a real life project, your feedback is super welcome.
I'm happy to guide you through the process, feel free to ask any question.
a
Oh awesome!! Thank you for the information. Id need to work through some details on how it will all coordinate. I imagine a “push” from a server to new schema update can use a GitHub action or our internal ci tool to publish a new release. Then downstream repos would open a pr against the new schema and try to merge it if all passes
m
If you're mainly interested in getting new schema updates automatically, I'd recommend taking a look at https://github.com/martinbonnin/update-graphql-schema instead (heads up it's working but some parts still need ironing)
Publishing a schema module will most likely "lose" some information because by default only the used types are generated. You can change that with the
alwaysGenerateTypesMatching
gradle options but then generating code for all the classes is a lot of bytecode (and compileKotlin time)
Publishing the Apollo metadata could be useful if you wanted to share fragments for an example but if it's only the schema, I don't think it's worth it?