-
Notifications
You must be signed in to change notification settings - Fork 94
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
Suport #include files #94
Comments
Any thoughts on this @jimkyndemeyer? I would also find this helpful, any ideas on how this might be done and I could possibly do a PR |
Hi Andrew. I think the first question you should think about is how you want the plugin to behave differently than what it does today. I'm thinking of feature areas such as go to definition, error highlighting, completion, query execution and so forth. Once you have that figured out, please describe it here, and I'll be better able to offer guidance. Depending on the scope, I would say this feature requires some experience with the IntelliJ Platform SDK, including working with PSI trees and the virtual file system. |
Thanks Jim, I'll look into it a bit more and give back with my findings. |
Hi Or at least of we could supress the error message somehow.. Thanks for effort! |
@jimkyndemeyer I haven't studied your code yet, but hope it will not be to hard to process the Main improvements:
|
+100 |
For what it's worth I got around this by writing a file watcher that watches my |
The RFC to add imports to GraphQL was closed without arriving at a standardized solution. The 2.0 release of this plugin shipped with a capability to resolve fragments across files, but bounded by schema scopes defined using graphql-config. The scoping allows for control over which fragments are visible from specific operations. Completion and error highlighting for fragment spreads follows this scoped resolution logic. For the upcoming 2.1 release contextual queries will automatically include these "resolvable" fragments when executing operations against GraphQL endpoints. This approach allows developers to use whatever import mechanism they deem as most fitting while adding a better DX while working with this plugin. The developers must take care to test their components actually import the required fragments, but testing is an established best practice. With the 2.0 release the plugin achieved compliance with the June 2018 GraphQL spec. Should imports become a part of an upcoming spec version I'll revisit as needed. Best regards, |
Greetings,
I suggest support the #include file notation as in:
http://dev.apollodata.com/react/webpack.html#Fragments
Examples:
#import "./UserInfoFragment.graphql"
and
#import "graphql-tag/loader!../../graphql-defs/contacts.graphql"
This way we can modularize a lot the queries.
Regards
The text was updated successfully, but these errors were encountered: