# GraphQL args and variables linkage

**URL:** <https://community.postman.com/t/graphql-args-and-variables-linkage/69983>\
**Category:** Help Hub\
**Tags:** variables, graphql, postman-ui\
**Created:** [October 19, 2024, 11:14pm UTC](https://community.postman.com/t/graphql-args-and-variables-linkage/69983 "2024-10-19T23:14:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![descent-module-ast13](https://avatars.discourse-cdn.com/v4/letter/d/e9c0ed/32.png) [@descent-module-ast13](https://community.postman.com/u/descent-module-ast13)\
**Post date:** [October 19, 2024, 11:14pm UTC](https://community.postman.com/t/graphql-args-and-variables-linkage/69983/1 "2024-10-19T23:14:57Z")

</div>

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:

```gql
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:
> 
> ```gql
> query Todo($id: Int!) {
> todo(id: $id) {
> id
> description
> isDone
> }
> }
> 
> ```
> 
> ### Variables Panel:
> 
> ```json
> {
> "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)

---

<div class="post-metadata">

**Author:** ![danny-dainton](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/danny-dainton/32/29401_2.png) [@danny-dainton](https://community.postman.com/u/danny-dainton)\
**Post date:** [October 21, 2024, 10:07am UTC](https://community.postman.com/t/graphql-args-and-variables-linkage/69983/2 "2024-10-21T10:07:29Z")

</div>

Hey @descent-module-ast13 👋

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:

> **[Build software better, together](https://github.com/postmanlabs/postman-app-support/issues/new?assignees=&labels=feature&projects=&template=feature_request.yml&title=%3Ctitle%3E)**
>
> GitHub is where people build software. More than 100 million people use GitHub to discover, fork, and contribute to over 420 million projects.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/system/32/29796_2.png) [@system](https://community.postman.com/u/system)\
**Post date:** [November 20, 2024, 10:07am UTC](https://community.postman.com/t/graphql-args-and-variables-linkage/69983/3 "2024-11-20T10:07:34Z")

</div>

Closed on November 20, 2024, 10:07am UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
