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
880 stars 97 forks source link

Restore v3 env variable handling? #663

Closed arlampin closed 1 year ago

arlampin commented 1 year ago

Describe the bug We have following config in our project:

schema: "graphql-schema/schema.graphql"
extensions:
  endpoints:
    dev:
      url: "http://localhost:9000/graphql"
      headers:
        authorization: "Bearer ${GQL_DEV_TOKEN}"
    staging:
      url: "https://api-staging.REDACTED/graphql"
      headers:
        authorization: "Bearer ${GQL_STAGING_TOKEN}"
    production:
      url: "https://api.REDACTED/graphql"
      headers:
        authorization: "Bearer ${GQL_PRODUCTION_TOKEN}"

Each developer has GQL_DEV_TOKEN in their local .env.local file, but staging/production tokens are only created and configured as needed.

In v3 doing a request against dev endpoint didn't ask GQL_STAGING_TOKEN or GQL_PRODUCTION_TOKEN keys, so they almost never needed to be configured. But with v4, doing any request asks for both missing tokens. It would be very convenient if v3's env variable handling could be restored.

Version and Environment Details IDE name and version: IntelliJ IDEA 2023.1 (Ultimate Edition) Plugin version: 4.0.0

vepanimas commented 1 year ago

That was definitely overlooked. Now, all variables in the config are required to be configured, which is not okay. I will fix that. Thank you for reporting it.