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

Generate Relay @connection types for GraphQL Java Tools #503

Open hameno opened 2 years ago

hameno commented 2 years ago

I'm using the Relay connection support from https://www.graphql-java-kickstart.com/tools/relay/. Currently the IDE shows errors due to the connection types not existing. Is there a way to ignore / generate those types for validation when using the directive? I'm aware of #326 but is there a way to tell the plugin to automatically generate for connection types (see example below)?

image

vepanimas commented 2 years ago

Hi! It's possible that we could create those types if they are not present dynamically, but it's not implemented yet. One problem that I see is that a @connection directive from the library you mentioned conflicts with an existing Relay connection directive for fields https://relay.dev/docs/api-reference/graphql-and-directives/#connectionkey-string-filters-string.

You could disable those warnings by pressing alt + enter, then select an inspection, press the right arrow and then choose a suitable Suppress for ... action (see a video below). Or you even could disable those inspections completely in the settings.

https://user-images.githubusercontent.com/10243762/139510924-65aba139-3963-48ef-9910-83fd40eca2af.mp4