js-graphql-intellij-plugin
js-graphql-intellij-plugin copied to clipboard
Unable to change runtime variable after first time
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:
- Create a variable in
config.graphql.yml
- Perform a GraphQL query/mutation
- Set a value for that variable and run the operation
- 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
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
I'll fix it in the upcoming 2023.3 release.
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 if you want to persist the variables, why don't just create an .env
file? Here is the docs.
@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 I created an issue for that 👍
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.
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.