# Variables

## Variables

GraphQL offers a way to reuse your queries dynamically through [variables](https://graphql.org/learn/queries/#variables). These will come into play especially if you're accessing the API programmatically (such as our [Node or Python examples](/getting-started-1/usage.md#api-access)).

Before:

{% tabs %}
{% tab title="Query (no variables)" %}

```graphql
{
  course(id: "00000000-5945-95c7-65fd-a9747b200317") {
    id
    title
    flows {
      title
    }
  }
}
```

{% endtab %}

{% tab title="Response" %}

```javascript
{
  "data": {
    "course": {
      "id": "00000000-5945-95c7-65fd-a9747b200317",
      "title": "History of Dunder-Mifflin",
      "flows": [
        {
          "title": "Founding a Company"
        },
        {
          "title": "Corporate Citizenship"
        }
      ]
    }
  }
}
```

{% endtab %}
{% endtabs %}

With variables:

{% tabs %}
{% tab title="Query (with variables)" %}

```graphql
query($courseId: UUID!) {
  course(id: $courseId) {
    id
    title
    flows {
      title
    }
  }
}
```

{% endtab %}

{% tab title="Response" %}

```javascript
{
  "data": {
    "course": {
      "id": "00000000-5945-95c7-65fd-a9747b200317",
      "title": "History of Dunder-Mifflin",
      "flows": [
        {
          "title": "Founding A Company"
        },
        {
          "title": "Corporate Citizenship"
        }
      ]
    }
  }
}
```

{% endtab %}
{% endtabs %}

Here's an example of what this would look like [in the API Explorer](/getting-started-1/usage.md#session-based-graphiql):

![GraphiQL allows variables to be passed on the bottom-left pane.](/files/-MSd2LcjhVG898I8xEgY)

#### See also

* [Working with variables](https://docs.github.com/en/graphql/guides/forming-calls-with-graphql#working-with-variables) from GitHub's GraphQL API docs ([archive.org](https://web.archive.org/web/20210203142000/https://docs.github.com/en/graphql/guides/forming-calls-with-graphql#working-with-variables))
* [GraphQL Variables](https://shopify.dev/concepts/graphql/variables) from Shopify's API docs ([archive.org](https://web.archive.org/web/20200420144945/https://shopify.dev/concepts/graphql/variables))

##

##


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.eduflow.com/graphql/advanced-concepts.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
