cynic
cynic copied to clipboard
Support for downloading schemas
Was pointed out in #88 that it would be good to have a way of downloading schemas as part of a build step. Right now you either have to commit your schema to the repository or use some 3rd party tool to download which is not ideal.
Need to think about how best to do this though - as pointed out in #64 adding an HTTP client dependency could have a big impact on size when targetting WASM, so probably don't want this in cynic
itself. Possibly a CLI or part of cynic-codegen
, which is meant more as a build time dependency than a run time dependency.
For downloading the schema from build.rs
and for the usage by a custom build tool (like Seeder) - I would rather call a library directly instead of a CLI.
But schema requesting can be slow and you may pay for it when you create your serverless GQL endpoint. So I think we'll often have to implement some kind of caching or we'll want to run a CLI command manually or during the final code verification (e.g. on a pre-commit hook and on the CI pipeline).
So I don't have a clear favorite here.
P.S. Perhaps https://github.com/wingertge/artemis/tree/master/artemis#getting-started and https://github.com/wingertge/artemis/tree/master/artemis-build/src/introspect help with the implementation.