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

Federation 2 schema definition support #627

Closed bystam closed 1 year ago

bystam commented 1 year ago

Hello!

We use this lovely plugin (transitively through the Netflix DGS IntelliJ plugin) and noticed that it even has opt-in Federation support, which is super neat!

What I noticed though is that Federation 2 is out now, and that it comes with an updated schema specification.

I saw that one of the DGS maintainers added Federation support in 2021 in this PR, and it looks like the actual definition of the Federation types are defined in a simple file containing the Federation 1 subgraph schema.

I am interested in adding Federation 2 support to the plugin - but this is the first time I visit this plugin codebase. I am interested in opening a PR for this, but wonder if I could get some guidance.

Do you think it will be as easy as updating the Federation.graphql file to contain the updated definitions? As far as I can see, the Federation 2 definition is backwards compatible with the existing one. I also didn't see any particular tests added with the original Federation PR - are tests relevant?

smyrick commented 1 year ago

@bystam Since the directive definitions of Fed 2 are backward compatible (if used in one file, see FieldSet) we should be able to just update in place without making any separate Fed 2 configs

https://www.apollographql.com/docs/federation/subgraph-spec/

bystam commented 1 year ago

@smyrick Yeah that was my thought as well. Are you one of the maintainers, and if so endorsing simply adding the definitions in the existing file?

Not 100% certain what you mean "if used in one file, see FieldSet" part though. Care to elaborate? :)

smyrick commented 1 year ago

@bystam I am not a maintainer. So I don't know the full steps, but I have started the update here: https://github.com/JetBrains/js-graphql-intellij-plugin/pull/632