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

Feature request: Add response handlers #682

Open Eddy84 opened 11 months ago

Eddy84 commented 11 months ago

Thank you for the amazing plugin which really saves me a lot of time working on graphql backends.

There is one thing I would really like to see in this plugin which is already implemented in the PHPSTORM rest client.

The rest client allows you to add JS code as response handler like the example below:

### Authorization by token, part 1. Retrieve and save token.
POST https://httpbin.org/post
Content-Type: application/json

{
  "token": "my-secret-token"
}

> {% client.global.set("auth_token", response.body.json.token); %}

This feature would be really nice in order to run queries with dynamic data Right now I have to pick the auth token and place it into the .env file to test queries that require authorization

Eddy84 commented 3 months ago

pump