JetBrains / js-graphql-intellij-plugin

GraphQL language support for WebStorm, IntelliJ IDEA and other IDEs based on the IntelliJ Platform.
https://jimkyndemeyer.github.io/js-graphql-intellij-plugin/
MIT License
879 stars 97 forks source link

Option to use .graphqls from external libraries #624

Closed bramklg closed 4 months ago

bramklg commented 1 year ago

I'm using an external library in my project that has a .graphqls file where some directives are defined. I would like to tell the plugin that it also needs to scan/use the files from that library so I have proper autocompletion and documentation.

As far as I know, this isn't possible yet, am I right or did I overlook something in the documentation?

samjcombs commented 1 year ago

+1 to this. Specifically I'd like to include .graphqls files in a java dependency. I tried configuring .graphqlconfig a few different ways to no avail. This would be a great feature.

samjcombs commented 1 year ago

^^^ bump, any movement on this one? I'm thinking of forking this functionality...

vepanimas commented 1 year ago

Hi! I've reworked the configuration in the last update to match modern GraphQL configuration approaches. This means that we can finally start thinking about extending it to meet more specific needs. Do you have a proposal for how we should configure which libraries to include? I thought about that and see some possible problems along the road, but maybe we can find a good enough solution together.

For instance, the most challenging scenario is a multi-project GraphQL setup that includes multiple libraries, some of which should be linked with project 1 and not project 2.

alexeyzimarev commented 1 year ago

@vepanimas it seems like something got broken in the config discovery with the new release. I get this message:

image

and the file is right there:

image

It definitely worked fine just last week. Sorry for hijacking the issue, it seems to be related to configs.

vepanimas commented 1 year ago

@alexeyzimarev hi, it's definitely not related to that issue. Do you use Rider? If so, please, try https://github.com/JetBrains/js-graphql-intellij-plugin/issues/647#issuecomment-1446197174. A possibly related issue https://github.com/JetBrains/js-graphql-intellij-plugin/issues/659.

bramklg commented 7 months ago

Any update on this? Is 'my' problem going to be solved some day or is this just something I have to work around/deal with?

vepanimas commented 4 months ago

@bramklg hi! I finally started working on that. Could you please provide a more detailed description of the project's structure? I'm particularly interested in understanding the layout of the library where the GraphQL files are stored. Probably, it looks something like that on the screenshot? it would be even better if you could provide library artifact ID for testing purposes if it's open-source.

image

vepanimas commented 4 months ago

Fixed, should be available in the next 2024.1 EAP. Please feel free to reach out if you have any questions or feedback.

bramklg commented 4 months ago

Hi @vepanimas. Tnx for implementing this! I forgot to answer your question but the structure looks indeed a bit like your screenshot. We have internal shared libraries containing .graphqls files used in other projects. If you still need a sample project lmk.