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

3.4.0 -> v4 (Breaking changes were introduced) #672

Closed stephenjason89 closed 1 year ago

stephenjason89 commented 1 year ago

Before you create the issue

Describe the bug Breaking change introduced with v4

To Reproduce This is how it looks like after upgrading to 4

image

.graphqlconfig

image

Expected behavior version 3.4 everything is working fine

image

Version and Environment Details Operation system: mac os ventura IDE name and version: intellij idea 2022.3.2 Plugin version: 4 onwards

Additional context Rolling back to 3.4 fixes everything

vepanimas commented 1 year ago

Could you please try a new configuration format? Docs about modern graphql-config itself are here.

This is a breaking change, which is why it is a major release. We have finally migrated to a modern graphql-config, which has been used by other IDEs and editors for a while. The current implementation of config management is very close to the graphql-config source code. Despite many efforts to maintain both versions simultaneously to at least some extent, a small migration (or updating to a better modern graphql-config) is still required.

Please, could you try to replace the existing .graphqlconfig with a graphql.config.yml? But don't forget to check the paths before:

projects:
  backend:
    schema:
      - ./graphql/**
      - ./schema-directives.graphql
    documents: ./backend/** # queries in the backend project, if they exist
  frontend:
    schema: ./storage/app/lighthouse-schema.json
    documents: ./src/**/*.{js,ts} # queries in the frontend project

If your backend project don't have any queries, you can put a frontend project to the first place, in that case every graphql query will be associated with it implicitly, it's even easier:

projects:
  frontend:
    schema: ./storage/app/lighthouse-schema.json
  backend:
    schema:
      - ./graphql/**
      - ./schema-directives.graphql
efstathiosntonas commented 1 year ago

Had the same issue, it fixes it self ~automatically~ automagically after switching to .yml config file

stephenjason89 commented 1 year ago

@vepanimas I just tried your solution and it worked perfectly. Sorry for the very late reply as I might have overlooked this issue.

Again, thank you so much!