# Unable to use an env variable in the graphQL Client

**URL:** <https://community.postman.com/t/unable-to-use-an-env-variable-in-the-graphql-client/57139>\
**Category:** Help Hub\
**Tags:** variables\
**Created:** [January 31, 2024, 5:44pm UTC](https://community.postman.com/t/unable-to-use-an-env-variable-in-the-graphql-client/57139 "2024-01-31T17:44:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![altimetry-administ10](https://avatars.discourse-cdn.com/v4/letter/a/977dab/32.png) [@altimetry-administ10](https://community.postman.com/u/altimetry-administ10)\
**Post date:** [January 31, 2024, 5:44pm UTC](https://community.postman.com/t/unable-to-use-an-env-variable-in-the-graphql-client/57139/1 "2024-01-31T17:44:24Z")

</div>

I am using the GraphQL client and am unable to use an env variable while passing an arg value. Is there something similar to using a variable, say {{id}} as an arg value for the GQL query?

---

<div class="post-metadata">

**Author:** ![gbadebo-bello](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/gbadebo-bello/32/12175_2.png) [@gbadebo-bello](https://community.postman.com/u/gbadebo-bello)\
**Post date:** [February 1, 2024, 9:06am UTC](https://community.postman.com/t/unable-to-use-an-env-variable-in-the-graphql-client/57139/2 "2024-02-01T09:06:36Z")

</div>

Hi @altimetry-administ10. Welcome to the Postman Community!

Yes, there is. You can use an environment/collection/global variable in a GraphQL request. Simply use this variable in the Variables tab of the GraphQL Query Builder, as shown below.

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/1/4/14b7371236090b83fddc3341afbb33299cadfd2b.png)

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/5/2/522451e14ab163ff6e1a68fbf81452d44dccd61a.png)

Remember to declare these variables in your GraphQL Schema as variables in Postman are passed onto the Schema.

---

<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:** [March 2, 2024, 9:07am UTC](https://community.postman.com/t/unable-to-use-an-env-variable-in-the-graphql-client/57139/3 "2024-03-02T09:07:04Z")

</div>

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