Comments (10)
Hey @vepanimas thanks for providing a fix for this, I can confirm that it's working with the 4.0.2
and adding a graphql.config.js
in the root of the project.
from js-graphql-intellij-plugin.
@arm1n hey, could you please try a new plugin build with the fix? Does it fix the problem? Please, note that Gatsby expects you to create a graphql.config.js
in the root of the Gatsby project, it's the same folder that contains the .cache
dir. [docs]
js-graphql-intellij-plugin-4.0.2.zip
from js-graphql-intellij-plugin.
This is not fixed in the released 4.0.2.
EDIT: I also installed from the zip here and it didn't work.
It's not working when the folder is excluded... it shouldn't be a surprise that an auto generated file that only works with a specific plugin might be excluded.
from js-graphql-intellij-plugin.
It's not working when the folder is excluded... it shouldn't be a surprise that an auto generated file that only works with a specific plugin might be excluded.
@robclancy Why do you think it should be excluded?
from js-graphql-intellij-plugin.
It's a cache and tmp folder...
from js-graphql-intellij-plugin.
@robclancy Yep, it's correct, though, why do you need to exclude it? You usually exclude a folder if you don't want the files inside of it to be indexed and to appear in completion, resolve, navigation, etc. Nevertheless, we do have an issue related to that, but it's not yet clear when it will be implemented.
From the IntelliJ IDEA docs:
Files in excluded folders are ignored by code completion, navigation and inspection. That is why when you exclude a folder that you don't need at the moment, you can increase the IDE performance. Normally, compilation output folders are marked as excluded.
Apart from excluding the entire folders, you can also exclude specific files.
To sum things up, generated != excluded.
from js-graphql-intellij-plugin.
What are you talking about? A tmp and cache folder is always excluded. A tmp folder is used for generated files. This issue is not resolved because if you exclude the folder that you should be excluding, the entire reason for the exclude feature to exist, then gatsby graphql config does not work.
from js-graphql-intellij-plugin.
What are you talking about?
Look, when you want a file to be excluded from indexing, you mark it or the whole folder as excluded. That's what is written in the docs I provided. For some technologies, e.g. node.js and its node_modules, we have some workarounds, that allow us to use excluded files for completion and resolve, but usually, when you exclude something, it's completely ignored by the IDE.
The easiest way for now to bypass that and leave the .cache
folder excluded is to un-exclude a specific directory you need, for Gatsby it is .cache/typegen
.
gatsby-exclusion.mp4
from js-graphql-intellij-plugin.
Nothing you have said has contradicted anything I have said. I have no idea why you are saying these things.
from js-graphql-intellij-plugin.
I was wondering why it doesn't work, and it appears that it's because of a hidden directory (#673).
I managed to get it working with a workaround:
- make a symlink to
.cache/typegen/schema.graphql
in root folder - copy
graphql.config.json
from.cache/typegen
to root folder. Config is very simple, and copypasting it is not a big deal. - set
schema
field in config toschema.graphql
And voila, webstorm recognizes my queries now.
If you don't want to commit symlinks, link can be renamed like schema.local.graphql
and added to gitignore.
from js-graphql-intellij-plugin.
Related Issues (20)
- Third-Party Plugins Notice HOT 1
- Feature request: Add response handlers
- Implement GraphQL formatter HOT 2
- Introspection is broken since V4 update, and all previously generated schema is no more recognisable by Graphql plugin HOT 6
- Custom directives in schema "tried to use an undeclared directive" HOT 1
- feature: Automatic copy of fields in interface
- The front end cannot recognize fields and types. Can it provide access to the remote gateway to obtain the scheme and provide code completion and checking functions? HOT 3
- Plugin crashes PyCharm every day
- Failed to evaluate config in TS-based project with ESM imports HOT 3
- Unable to change runtime variable after first time HOT 8
- @octokit/graphql-schema not working HOT 3
- Persist manually provided environment variables between IDE restarts
- Feature Request: add support custom http request headers for individual requests, similar to Apollo Playground HOT 1
- GraphQL Java dependency HOT 1
- PhpStorm gatsby autodiscover error HOT 2
- A way for plugins to manage library definitions HOT 2
- Glob pattern not working for schema config
- GraphQL intropection: The server introspection response cannot be parsed as a valid JSON object. HOT 2
- Unexpected "Unknown directive location" errors when viewing schema
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from js-graphql-intellij-plugin.