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

Rework GraphQL query variables editor

Open denys-meloshyn opened this issue 4 years ago • 3 comments

As a new user of your plugin it was not obvious to understand how to provide custom variables. After some time I noticed "Toggle variable editor" but after that I was confused in which format I should provide my variable: JSON, YML or another.

Describe the solution you'd like Tutorial with step by step would help very much.

denys-meloshyn avatar Mar 29 '20 11:03 denys-meloshyn

Where is this "Toggle variable editor" option? I'm totally lost. I can't figure out how to provide variables to the queries. Any kind of documentation will help.

ashwins93 avatar Jun 06 '20 14:06 ashwins93

@ashwins93 You'll find the variables button in the toolbar for each GraphQL file tab. It's a yellow V left to the endpoint URL dropdown. Variables are entered as JSON:

{
  "nameOfVariable": "value",
  "nameOfVariableForInputObject": {
    "inputValue": "input value,
    "listValue": ["item1", "item2"]
  }
}

There is an example at https://graphql.org/learn/queries/#variables which shows how this comes together.

jimkyndemeyer avatar Jun 08 '20 07:06 jimkyndemeyer

I think we can rework the variable editor in the next releases, it's a bit confusing now. It should have the same UX as GraphiQL with variables in a separate collapsible tab.

image

vepanimas avatar Aug 31 '20 12:08 vepanimas