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

Plugin cannot handle graphql schema defined in parent directories

Open invokermain opened this issue 3 years ago • 5 comments

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

invokermain avatar Sep 21 '22 12:09 invokermain

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)

reckter avatar May 08 '23 15:05 reckter

@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

cdignam-segment avatar Sep 13 '23 21:09 cdignam-segment

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.

vepanimas avatar Oct 14 '23 10:10 vepanimas