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

Feature request: Support separate auto correct and jump to source #630

Open Stevemoretz opened 1 year ago

Stevemoretz commented 1 year ago

Hi, Let's see an example. You have defined two projects, one includes just the server graphql files let's say at /central/graphql/ and your other project needs only one graphql file which is generated from the server's graphql files let's say at ./central/graphql-queries/compiled/schema.graphql perfect.

Now you get autocompletion on the client files and also no error in server files, but in a client file hold Ctrl button and click a word so it jumps to its definition, it will jump to the source definition which is the generated file at ./central/graphql-queries/compiled/schema.graphql but instead that should jump to the real server source file.

{
  "name": "Lighthouse GraphQL Schema",
  "projects": {
    "server" : {
      "name": "server",
      "includes": ["./central/graphql/**/*", "./central/*"],
      "schemaPath": "./schema.graphql"
    },
    "client" : {
      "name" : "client",
      "excludes": ["./central/graphql/**/*", "./central/*"],
      "schemaPath": "./central/graphql-queries/compiled/schema.graphql"
    }
  },
  "extensions": {
    "endpoints": {
      "Default GraphQL Endpoint": {
        "url": "http://graphql.test/wp-json/central/api/graphql",
        "headers": {
          "user-agent": "JS GraphQL"
        },
        "introspect": true
      }
    }
  }
}

So also might want to check the words of the original creator of plugin about this: https://github.com/jimkyndemeyer/graphql-config-examples/issues/11#issuecomment-1337047870