-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[Modern:rc.2|3] createFragmentContainer does not allow variable as second argument #1698
Comments
Unfortunately this is a known issue - the babel plugin looks for fragments in a particular place. Could you try not using the wrapping ie. const fragments = graphql`
...
`;
createFragmentContainer(Component, fragments) I'm curious if this works out of the box |
@leebyron Nope, same issue. It also doesn't identify the file causing the problem, btw:
|
@guigrpa you can try this:
|
@seanchas It worked! Thanks a lot for the workaround |
Could someone explain why this doesn't work:
and this does:
This won't allow to create a HOC around |
I think this is related: #1790 |
Is this working? Im facing the same issue and creating the variable const fragment = graphql`fragment ......` then createFragmentContainer(MyComponent, fragment) still triggers the parse error |
Was this ever fixed? |
This works:
But this doesn't:
The Relay Compiler complains:
FindGraphQLTags:
createFragmentContainerexpects a second argument of fragment definitions.
.In practice, this prevents the definition of fragments at the top of the file, which is where they arguably make more sense.
Not a major issue; keep up the good work!
The text was updated successfully, but these errors were encountered: