js-graphql-intellij-plugin icon indicating copy to clipboard operation
js-graphql-intellij-plugin copied to clipboard

Unable to change runtime variable after first time

Open lorthirk opened this issue 1 year ago • 8 comments

Before you create the issue

  • If you're using an EAP, try with a stable version. If that works, please mention it in the issue along with both versions
  • Please search the existing issues before opening a new issue
  • Review the developer guide

Describe the bug I have a TOKEN variable defined in my graphql.config.yml file so that I can pass a JWT Token when I make some calls. After I enter it the first time (by pressing Cmd+Enter on a query defined in a .graphql file), I cannot change it anymore because clicking the "Edit Environment Variables" shows the variable with an empty value, and changing it doesn't have any effect.

To Reproduce Link to Repo with Reproduction or Steps to Reproduce:

  1. Create a variable in config.graphql.yml
  2. Perform a GraphQL query/mutation
  3. Set a value for that variable and run the operation
  4. Open the "Edit Environment Variables" button to change the value

Expected behavior The "Edit Environment Variables" window opens with the variable with the old value, allowing to change its value

Version and Environment Details Operation system: macOS Ventura 13.5.1 IDE name and version: IntelliJ Ultimate 2023.2.2 Plugin version: 4.0.2

lorthirk avatar Sep 20 '23 07:09 lorthirk

I have the exact same issue.

Version and Environment Details Operation system: Linux fedora 6.5.5-100.fc37.x86_64 IDE name and version: IntelliJ Ultimate 2023.2.3 Plugin version: 4.0.2

kajmaj87 avatar Oct 12 '23 09:10 kajmaj87

I'll fix it in the upcoming 2023.3 release.

vepanimas avatar Oct 14 '23 10:10 vepanimas

If you want I can open a different issue for a different feature, but IMHO it would be great to have the variable saved somehow with the .graphql file, so that I don't have to populate them every time I restart IntelliJ.

lorthirk avatar Oct 14 '23 10:10 lorthirk

@lorthirk if you want to persist the variables, why don't just create an .env file? Here is the docs.

vepanimas avatar Oct 14 '23 11:10 vepanimas

@lorthirk if you want to persist the variables, why don't just create an .env file? Here is the docs.

Uhm... I was still thinking about input variables rather than envs. Sounds impractical to pollute the envs with objects to be used as inputs in queries, especially when I have many queries.

lorthirk avatar Oct 14 '23 11:10 lorthirk

@lorthirk I created an issue for that 👍

vepanimas avatar Oct 14 '23 12:10 vepanimas

I'm sorry, I realize now I was not clear.

In my second comment I was referring to input variables, the ones with the yellow "V" button, not environment variables.

lorthirk avatar Oct 14 '23 13:10 lorthirk

Ah, my bad. For that one, we already have an issue with a long history https://github.com/JetBrains/js-graphql-intellij-plugin/issues/83.

vepanimas avatar Oct 14 '23 13:10 vepanimas