-
Notifications
You must be signed in to change notification settings - Fork 49
Description
I've described it in some detail in the PR that fixes this issue here #104, but I'm opening an issue to track it. If that's not the right way to do this, then feel free to close this issue.
The problem code:
import MyComponent from './';
graphql`fragment foo on Page {
...MyComponent_foo
}`
Currently throws the error:
This spreads the fragment
MyComponent_foobut this module does not use it directly. If a different module needs this information, that module should directly define a fragment querying for that data, colocated next to where the data is used.
Which is highly confusing, as it is imported.
I believe this is an edge-case surfaced by our pattern of importing relative components in the same directory, so I've tried to tweak the module parser to handle this by checking the name of the parent directory in my PR.
Another option would be to operate on the variable name but that seems far worse and too much like the strict horrors of Relay compat.