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

Schema reuse ver 4 #661

Closed andrzejbl closed 1 year ago

andrzejbl commented 1 year ago

Hi,

in the previous version, I've been reusing graphql files across many projects. for example, I used libs/pricing/schema.graphql

in many other schemas. It worked very well so far. After upgrading to v4, projects defined after the project using one file are not seeing this file again. I'm using a single config file for the whole project.

Is this a bug or there was an intentional change?

vepanimas commented 1 year ago

@andrzejbl Hi! To be honest, I didn't think about that scenario and haven't tested it for that case 😞. I've implemented the config matching as closely as possible to the https://github.com/kamilkisiela/graphql-config library. Therefore, I need some time to figure out how it works there.

You can try to downgrade a plugin to a 3.4.0 version as a temporary solution, sorry for the inconvenience.

It would be great if you could share the config file you use, of course without any endpoints, credentials, or other sensitive data.

andrzejbl commented 1 year ago

Here is an example of my config for older version:

   "PhotographerServer": {
      "includes": [
        "./graphql/apps/photographer/src/**/*.graphql",
        "./graphql/libs/organization-offer/**.graphql",
        "./graphql/libs/organization-offer-front/**.graphql",
        "./graphql/libs/upload/*.graphql",
        "./graphql/schema/common.graphql"
       .....
      ]
    },
    "PhotographerClient": {
      "includes": [
        "./projects/photographer-panel/src/app/queries.graphql", <-- frontend queries
        "./graphql/apps/photographer/src/**/*.graphql",
        "./graphql/libs/organization-offer/*.graphql",
        "./graphql/libs/organization-offer-front/*.graphql",
        "./graphql/libs/upload/*.graphql",
        "./graphql/schema/common.graphql"
          ...
      ]
    }

Downgrane solved the problem temporarily. Let me know if I can be of any help.

vepanimas commented 1 year ago

@andrzejbl What IDE version do you use? I think I fixed it but it would be great if you could try it before the release.

andrzejbl commented 1 year ago

Webstorm: Build #WS-231.8109.174, built on March 28, 2023

vepanimas commented 1 year ago

@andrzejbl Could you please try this recent build including a fix? Does it work for your project setup?

js-graphql-intellij-plugin-4.0.0.zip

andrzejbl commented 1 year ago

at first glance looks like it works

On Wed, 26 Apr 2023 at 16:15, Vladimir Panimaskin @.***> wrote:

@andrzejbl https://github.com/andrzejbl Could you please try this recent build including a fix? Does it work for your project setup?

js-graphql-intellij-plugin-4.0.0.zip https://github.com/JetBrains/js-graphql-intellij-plugin/files/11333834/js-graphql-intellij-plugin-4.0.0.zip

— Reply to this email directly, view it on GitHub https://github.com/JetBrains/js-graphql-intellij-plugin/issues/661#issuecomment-1523498575, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABMFHG2III27YIDSNSJXKKDXDEUZPANCNFSM6AAAAAAXLMRONA . You are receiving this because you were mentioned.Message ID: @.***>

Kikketer commented 1 year ago

Having the same-ish problem here. None of my graphql files nor ts/js type files recognize my schema anymore as of version 4.0.0. I downgraded to 3.4.0 and things work again out-of-the-box.

For reference I'm in a mono-repo

config 
  schema.graphql
packages
  projectName
    src
      someDirectory
        someFile.ts               << has gql` ` in it
        somegraph.graphql << just your standard graphql file
reckter commented 1 year ago

@vepanimas When can we expect the fix to land in the release version?

vepanimas commented 1 year ago

@reckter We'll release it by the end of the week, we’re testing the build at the moment🤞.