-
Notifications
You must be signed in to change notification settings - Fork 21
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
Recurse through #import in GQL files #35
Comments
+1 to this issue. Having the same difficulty. |
same issue for me |
Referencing my issue posted in CRA as the cause is likely here. |
Same issue |
evenchange4
pushed a commit
that referenced
this issue
Jan 24, 2019
This PR adds recursive imports processing which allows imported files to import other files. It solves #35
Release |
@evenchange4 should we close this issue since it's fixed? |
Sure, close it. Please feel free to reopen this issue if the problem still occurs. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm trying to upgrade our app to Create React App 2.0 right now and in the process switching from graphql-tag/loader (used with some custom config in react-app-rewired)
So our syntax changes from
to
So that's fine, but I'm noticing that the
#import
macro also doesn't work like in graphql-loader.If I have
The query that results is just
That is - it doesn't recurse and parse the imports in the file it's imporing to do that second level of importing. We have a few objects with nested references to other objects and to avoid duplicating the same common fields in those objects we make frequent use of this.
The workaround right now is to make sure all the nested fragments are explicitly imported in the query, which is not super hard, but it gets more tricky if you want to add an import in a fragment that is used in multiple queries because you have to find and update all those queries. In short, I preferred the graphql-loader implementation.
So - is this a deliberate choice, or could this behaviour be added here?
The text was updated successfully, but these errors were encountered: