-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Auto-complete issue with multiple projects and schemas #714
Comments
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 Another annoying thing: we don't need to use the |
@benjamindulau The first config you provided is supposed to work in a monorepo scenario. When the plugin tries to match a file with a project in it, in your case it just chooses the first one, because both are applicable. To properly separate the projects, you need to add a If you need to access both schemas from a single file or query, the only approach is what you described in the second comment. We have some merging logic under the hood for such cases, but it's not perfect, and as you noticed it will show errors. You can try disabling these errors:
That's not supported; only specific and pre-defined injections work due to some technical limitations. |
@vepanimas Thank you for the follow-up.
I'm curious what are those technical limitations. Are they because of PhpStorm itself? Isn't there a way by defining a custom function name in the configuration? |
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
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
The text was updated successfully, but these errors were encountered: