Closed amcvitty closed 5 years ago
+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
Release v1.2.0
with recursive import feature.
@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.
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?