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 gives schema validation errors for values of an extended scalar type #631

Open luispollo opened 1 year ago

luispollo commented 1 year ago

Given the following directive in a schema:

scalar JSON

"Custom Annotation"
directive @annotate(
  name: String!
  inputs: JSON
) repeatable on OBJECT | FIELD_DEFINITION | INPUT_OBJECT | INPUT_FIELD_DEFINITION

The plugin will flag the usage of the @annotate directive as invalid syntax in the usage site, for example:

type MyType {
  prop: String @annotate(name: "MyAnnotation", inputs: {value: ["test"]})
}

Errors reported:

Note that JSON is an extended scalar I've registered in my application. I'm guessing the problem has something to do with the fact that it requires registration at runtime, so I'm not sure how that would work with an IntelliJ plugin.

To Reproduce

  1. In an IntelliJ project, create a GraphQL schema file recognized by the plugin
  2. Add the definitions above
  3. The editor will highlight the usage site with a syntax error

Expected behavior No syntax errors are reported.

Screenshots image image

Version and Environment Details

srinivasankavitha commented 1 year ago

To add to the above description, the main issue is the fact that JSON is not recognized as a scalar when used with graphql-extended-scalars library : https://github.com/graphql-java/graphql-java-extended-scalars

torbenkeller commented 1 week ago

Any updates on this? Facing the same issue