GraphQL args and variables linkage

I’m using Postman’s GraphQL request type and when clicking on a query’s checkbox to automatically select all fields Postaman does the following:

query Todo {
    todo(id: null) {
        id
        description
        isDone
    }
}

Note that Todo is a simple query that expects an id in order to return a todo with that id.

Well, I was looking for a way in where Postman could automatically create an $id variable based on the arg’s name and also, automatically populate the variables panel resulting in the following behavior.

  1. User clicks on a query that expects some arguments.
  2. Postman automatically creates a query variable, and assigns it to the corresponding argument:

Query Editor:

query Todo($id: Int!) {
   todo(id: $id) {
       id
       description
       isDone
   }
}

Variables Panel:

{
   "id": null
}

Is there any way that I could get this behavior with Postman? I’ve looked through the documentation and Postman’s settings, but couldn’t find anything related to this.

Any help would be much appreciated it.


Aditional Information:

  • Postman Version: 11.17.1
  • OS: Linux (Fedora Workstation Edition - v40)

Hey @descent-module-ast13 :wave:

Welcome to the Postman Community! :postman:

There isn’t anything in the platform that I can think of that would automatically do that based on a query. You can use the dynamic variables with the GraphQL variables but that would still be a manual action.

You can raise a new Feature Request for this over on our Issue Tracker: