Closed james-johnston-thumbtack closed 1 year ago
Hi! Right now I'm migrating the GraphQL config to the modern version and it will support YAML as the main option for configuration files.
Oh that's awesome, I'm happy to hear we are able to do that migration!
Describe the bug The plugin contains an embedded JSON Schema at https://github.com/JetBrains/js-graphql-intellij-plugin/blob/d3d8d95ed8649d5c1ec0b1422f8a21c60c8ae78d/resources/schemas/graphql-config-schema.json which makes editing the .graphqlconfig files in JSON format really nice.
However, YAML is a better file format because it supports comments. And unfortunately, the embedded JSON schema is only being registered for the JSON files:
https://github.com/JetBrains/js-graphql-intellij-plugin/blob/009e8b15a8694b572d0b6d45d70b3afa7decb23d/src/main/com/intellij/lang/jsgraphql/ide/project/graphqlconfig/javascript/GraphQLConfigJsonSchemaProvider.java#L29-L36
note the constant here:
https://github.com/JetBrains/js-graphql-intellij-plugin/blob/009e8b15a8694b572d0b6d45d70b3afa7decb23d/src/main/com/intellij/lang/jsgraphql/ide/project/graphqlconfig/GraphQLConfigManager.java#L110
It would be nice if the plugin could automatically register its schema for the YAML config files as well.
To Reproduce Link to Repo with Reproduction or Steps to Reproduce:
.graphqlconfig.yaml
file and write the configuration in YAML format.Expected behavior The JSON Schema should be loaded and applied to the YAML file, so that code completion works correctly.
Workaround It is possible to manually set up a JSON Schema Mapping for the file, as shown in the screenshot below. Then it works. Of course it would be nice if this was automatic.
Version and Environment Details Operation system: macOS 13.2 IDE name and version: 2022.3.2 Plugin version: 3.4.0 (also bug is clearly in place given above code links that show registration only for JSON config files)