Open kbrandwijk opened 6 years ago
We ran into some issues with this previously. @ryanomackey was trying to get importSchema()
working, and it kept throwing errors. We ended up moving on to other work and haven't revisited this.
That being said, I'd love to have support for it. Any chance you've got time to put together a PR?
Would you want this compile-time or run-time?
It would need to work with the gramps dev
command (which transpiles code). As long as the CLI still works, I don't have a strong preference.
Relevant code for transpilation in the CLI:
https://github.com/gramps-graphql/gramps-cli/blob/master/lib/data-sources.js#L122-L143
There you go... ^^
It would be great if the datasource boilerplate would include support for
import
statements in schemas. See https://github.com/graphcool/graphql-import for details.This could be a build step (using the
graphql-cli bundle
command) or a run-time step (usingimportSchema()
.