js-graphql-intellij-plugin icon indicating copy to clipboard operation
js-graphql-intellij-plugin copied to clipboard

Is it possible to use with a local instropection schema.json ?

Open alexis-regnaud opened this issue 4 years ago • 6 comments

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

Steps to Reproduce / Link to Repo with Reproduction and Instructions

Here my actual .graphqlconfig :

Screen Shot 2020-05-20 at 10 40 01 AM

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

alexis-regnaud avatar May 20 '20 14:05 alexis-regnaud

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.

jimkyndemeyer avatar May 20 '20 14:05 jimkyndemeyer

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

alexis-regnaud avatar May 20 '20 15:05 alexis-regnaud

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.

jimkyndemeyer avatar May 20 '20 16:05 jimkyndemeyer

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

alexis-regnaud avatar May 20 '20 18:05 alexis-regnaud

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?

bzvikler avatar Mar 03 '21 22:03 bzvikler

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"
        }
      }
    }
  }
}

PiotrKuniniec avatar Feb 08 '22 21:02 PiotrKuniniec