This is an example of code of RelayModern
import AnotherComponent from './AnotherComponent';
const fragmentContainer = createFragmentContainer(
Component, {
viewer: graphql`
fragment Component_viewer on Viewer {
user(id: $id) {
id
...AnotherComponent_user
}
},
`
},
);
it will get the fragment from the AnotherComponent, but this plugin is think the fragment AnotherComponent_user is undefined
Example of fragment declaration in another file:
export default createFragmentContainer(AnotherComponent, {
user: graphql`
fragment AnotherComponent_user on User {
id
name
email
active
}
`,
},
);
+1.
I need this feature too, but I'm figuring if I can help to build it.
where or how can I find the knowledge to build this plugin?
@jimkyndemeyer could you pls hint some keyword to google~~
@jonirrings I think that implementing this issue requires quite a bit of experience with the IntelliJ Platform SDK. It cuts across the Virtual File system, PSI Files/Directories, CompletionContributor, Annotator, PSI References for go to definition etc., not to mention some kind of configuration or detection of Relay Modern when using the graphql tagged template litteral.
If you want to give it a try, the starting point is http://www.jetbrains.org/intellij/sdk/docs/
Also, to get this plugin up and running, see DEVELOPING.md
Unfortunately, due to other personal commitments, I don't have any spare time to work on this plugin until autumn at the earliest.
@asiandrummer is the work you're doing on integrating the GraphQL language service with IntelliJ of relevance to this issue?
Best regards,
Jim.
thanks for your reply, struggling with the SDK doc, hope I am ready before autumn:smile:
@jimkyndemeyer - I'm happy to make a monetary contribution ($100) if that would help get Relay 1.0 support. Perhaps others would as well.
I just found this plugin and quite like it, but we just finished a switch to modern so it yields a couple of the some errors everywhere. Please let me know.
@rosskevin Thanks for the support, but the limiting factor here is quite simply that I don't have the spare time to work on this project until autumn at the earliest.
A PR would be great, but realistically it would require a working knowledge of the IntelliJ IDEA SDK.
@jimkyndemeyer the latest push to graphql-language-service supports Relay Modern, and I'm currently working to support it in the IntelliJ as well. I'll update my progress here as things move forward!
can we just enable graphql.experimental syntax highlighting for now?
is it an easy fix?
there is a PR for this already https://github.com/jimkyndemeyer/js-graphql-intellij-plugin/pull/76
Merged graphql.experimental support for the 1.5.3 release. Pending approval in the Jetbrains plugin repo.
I've got 1.5.4 version and still have the same problem (described in first post). When can we expect support for Relay Modern?
Just give a status on this. I have made some progress on this, but the change cross-cuts all the major features such as completion, error highlighting, find usages, and go to definition.
This in combination with other personal commitments means that I don't have an expected ETA just yet, but I'll keep this issue updated.
@jimkyndemeyer is #76 the current status of this feature?
@chadfurman See my latest commit.
I should be able to get fragment support for you guys within the next week or so.
Version 1.6 with Relay Modern fragment support has been uploaded to the plugin repository and is now pending approval by Jetbrains.
@jimkyndemeyer Super cool! :)
@jimkyndemeyer it works great! Thank you so much!
@chadfurman Glad to hear it :)
This is absolutely great, thank you for this!
I'm using and including fragments from a separate package as well, residing in node_modules. Is there a way to tell your plugin to scan for fragments in that package as well?
I guess it'd mean I'd need to be able to set multiple paths for fragment scanning, as well as make the plugin scan .js.flow-files in addition to .js files, as all the .js-files will have had their actual fragment definitions removed, but the .js.flow-files won't have.
Thanks in advance!
@jimkyndemeyer great work on this
I'll close
it is awesome enough for me, tks
Ahh, I'll go ahead and open a new issue instead. :)
Most helpful comment
Merged graphql.experimental support for the 1.5.3 release. Pending approval in the Jetbrains plugin repo.