New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support graphql imports #722
Comments
I didn't know graphql can do that, is there a parser somewhere that we can use instead of splitting strings? |
I got the implementation from here: https://github.com/apollographql/graphql-tag/blob/main/loader.js#L29 If you try to use that parser, it's going to give you JavaScript which you can then parse. I had attempted to go that route at first but the textual parsing seems more efficient and doesn't add a lot of dependencies. |
Fair enough, if apollo does it that way then no need for us to get fancy about it :) |
The code above doesn't quite work, though ... still working on it. |
Would you accept a PR for this feature? Or should I just keep this local to our project? |
Oh I would definitely accept a PR for this! :) thanks |
Feature request description
GraphQL is a popular technology, which uses files with the
.graphql
extension to define schemas and operations. In many environments, these files can import other files (including from packages) use a syntax like:The given path is passed directly to node's
require
mechanism.Example parser implementation:
The text was updated successfully, but these errors were encountered: