gramps-graphql / data-source-base

Boilerplate for creating a GrAMPS-compatible data source.
https://gramps.js.org/data-source/data-source-overview/
52 stars 8 forks source link

Support schema imports #12

Open kbrandwijk opened 6 years ago

kbrandwijk commented 6 years ago

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 (using importSchema().

jlengstorf commented 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?

kbrandwijk commented 6 years ago

Would you want this compile-time or run-time?

jlengstorf commented 6 years ago

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.

jlengstorf commented 6 years ago

Relevant code for transpilation in the CLI:

https://github.com/gramps-graphql/gramps-cli/blob/master/lib/data-sources.js#L122-L143

kbrandwijk commented 6 years ago

There you go... ^^