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

Plugin cannot handle graphql schema defined in parent directories #615

Open invokermain opened 1 year ago

invokermain commented 1 year ago

Describe the bug With the following .graphqlconfig the plugin works as expected with the schema.graphql file being in the same directory in the config file.

{
    "name": "GraphQL",
    "schemaPath": "./schema.graphql"
}

However if I move the schema.graphql file into the parent directory of the .graphqlconfig the plugin stops working (no autocompletion/validation etc).

I have tried with both the following .graphqlconfig files:

{
    "name": "GraphQL",
    "schemaPath": "../schema.graphql"
}

or

{
    "name": "GraphQL",
    "schemaPath": "./../schema.graphql"
}

To Reproduce

  1. Move the schema file into a parent directory of the config file.
  2. Try to point to it in the config file using a valid relative path.

Expected behavior Plugin should be able to resolve the schema file.

Version and Environment Details Operation system: win10 IDE name and version: PyCharm 2022.2.2 Plugin version: 3.2.1

reckter commented 1 year ago

I have a similar Problem. We have a Monorepository and use one shared graphql-definition package.

So our schemaPath is something like: "../../packages/schema/build/graphql/api.graphql". But the plugin just silently doesn't include this.

Does someone have a workaround? even going through simlinked dependency installs doesn't seem to do the trick. (or well, "node_modules/schema.graphql" doesn't seem to work either, even when placing a file there)

cdignam-segment commented 10 months ago

@reckter Were you ever able to figure out a solution to this issue?

I'm having the same issue with a similar mono-repo setup

vepanimas commented 9 months ago

Schemas defined in parent directories should work in the upcoming 2023.3 release, you can try an already published EAP to check if the issue is solved for you.