js-graphql-intellij-plugin
js-graphql-intellij-plugin copied to clipboard
Is it possible to use with a local instropection schema.json ?
Before you create the issue
- Please search the existing issues at https://github.com/jimkyndemeyer/js-graphql-intellij-plugin/issues?q=sort%3Aupdated-desc before opening a new issue.
- Read the FAQ at https://github.com/jimkyndemeyer/js-graphql-intellij-plugin#faq
- If you're using an EAP, try with a stable version. If that works, please mention it in the issue along with both versions.
Version and Environment Details
Operation system: macOs Mojave 10.14.06
IDE name and version: Webstorm 2020.1.1
Plugin version: 2.4.0
Expected Behaviour
Plugin work based on introspection file shema.json
Actual Behaviour
Red words and unrecognized field
![Screen Shot 2020-05-20 at 10 33 28 AM](https://user-images.githubusercontent.com/15250423/82459527-0fd2f480-9a86-11ea-970f-0fb8b3bbf1e4.png)
Steps to Reproduce / Link to Repo with Reproduction and Instructions
Here my actual .graphqlconfig
:
![Screen Shot 2020-05-20 at 10 40 01 AM](https://user-images.githubusercontent.com/15250423/82459741-4741a100-9a86-11ea-9078-65b6d21205f0.png)
I tryed to generate the shema.json by Apollo client or by your plugin, the both work (The file is correctly generated) but still not recognized when I look inside .gql
files
I see this one which seems similar to this one : https://github.com/jimkyndemeyer/js-graphql-intellij-plugin/issues/305 , but it's also not resolved yet
Hi Alexis,
Thanks for using the plugin.
Could you try this with a schemaPath
that's ./schema.graphql
and then do the introspection.
There's an intermittent issue with json files as schemaPath that I haven't been able to reproduce locally.
When I use "schemaPath": "./schema.graphql"
the plugin works, but in my case I would prefer to use the schema.json
which is generated by my Apollo:client introspection instead
Ok, so this seems to be the same as #305 then.
If you switch back to the json file, does it work if you choose "File" - "Invalidate caches / Restart"? The issue could be related to indexing since the editor can't resolve references, but it suggests the right field name based on actually having loaded your schema.
If I changed schema.graphql
by schema.json
and click on "File" - "Invalidate caches / Restart"
, all still worked until I removed the file schema.graphql
Seems like the file is still linked
I'm running into the same issue. I'd like to use this plugin with the schema.json
file generated by Apollo Client. Has there been any progress here, @alex83130 were you able to get something working?
I had similar problem with Apollo and automatic generated schema as a JSON file, to solve that issue I’ve created .graphqlconfig file:
{
"schemaPath": "src/app/__generated__/graphql.schema.json",
"documents:": "src/app/__generated__/*.{graphql,js,ts,jsx,tsx}",
"extensions": {
"endpoints": {
"dev": {
"url": “GRAPHQL LINK",
"headers": {
"Authorization" : “YOUR TOKEN"
}
}
}
}
}