> ## Documentation Index
> Fetch the complete documentation index at: https://docs.usebruno.com/llms.txt
> Use this file to discover all available pages before exploring further.

# GraphQL Variables

Variables in GraphQL allow you to create dynamic, reusable, and secure queries. Instead of embedding values directly in your query string, you can use variables to pass values separately. This approach offers several benefits:

* **Security**: Prevents GraphQL injection attacks
* **Reusability**: Same query can be used with different values
* **Type Safety**: Variables are strongly typed
* **Readability**: Makes queries cleaner and easier to understand

## Adding Variables to Your GraphQL Request

1. Create a GraphQL Request
2. Add variables in the **Variables** section (bottom of query section)
3. Write your query or mutation with variables using the `$` prefix to declare variables and reference variables using the `$variableName` syntax.

<img src="https://mintcdn.com/bruno-a6972042/qClWzi66cJAFmDKE/images/screenshots/send-request/graphql/06-variables.webp?fit=max&auto=format&n=qClWzi66cJAFmDKE&q=85&s=c0076788dedc03c40588c9ea3206511d" alt="variables-section" width="2596" height="1470" data-path="images/screenshots/send-request/graphql/06-variables.webp" />

**Variables (JSON format):**

```json theme={null}
{
  "title": "usebruno",
  "userId": "1"
}
```

In this example, the `$title` and `$userId` are variables defined as a string and number respectively, and its value `"usebruno"` and `1` are passed separately in the Variables section.
