Open benjamindulau opened 1 month ago
Note: It works better if I configure a single project with both schemas documents:
schema:
- 'src/ST/GraphQL/schema/**/*.graphql'
- 'assets/website/remix/app/types/cms.graphql'
But it makes less sense I think, since they are two distincts schemas.
Also to get proper "multi schema" support, it should handle cases where there are duplicate field names across multiple schemas...
There is no way to inform PhpStorm which schema the query is intended for, so when different schemas contains identical field names, it considers the field from the first matching document to be valid but not the others.
It would be nice to be able to add some contextual information when making queries, like adding the targeted schema to /* GraphQL */
comment for instance.
Another annoying thing: we don't need to use the /* GraphQL */
comment for GraphQL code injection when using a function named graphql()
, which is great for DX. But we do if we use another name for the function, like cmsGraphql()
in our case. Is there a way to tell PhpStorm that cmsGraph()
acts like graphql()
?
Describe the bug
We're trying to setup multiple schemas in a project but auto-complete in code injections seems to only supports one of the defined project schemas.
One schema is our internal schema. The other one is a dumped schema from Strapi and is the reason why we need to add multi-schema support in the project.
Before we had this configuration:
Only one schema, so far so good..
Now we're trying to work with this configuration
Problem is we get autocomplete for the first schema (catalog) but not the other one, here is a video showing this: https://github.com/JetBrains/js-graphql-intellij-plugin/assets/430689/aad02209-2b39-4187-b9ba-daa4f838ee59
And as you can see in the following screenshots, both schemas are recognized by the plugin, and the
![Capture d’écran 2024-05-20 à 12 18 24](https://github.com/JetBrains/js-graphql-intellij-plugin/assets/430689/be7a740e-eda4-40fb-b0e3-1574b7e7f077)
guides
field exists in the dumpedcms.graphql
schema file used by the plugin:Version and Environment Details Operation system: macOS Ventura 13.2.1 IDE name and version:
Plugin version: 241.14494.150