# Fragments

You can also reuse chunks of your queries with [GraphQL fragments](https://graphql.org/learn/queries/#fragments):

{% tabs %}
{% tab title="With fragments" %}

```graphql
fragment ReuseableFragment on Course {
  id
  title
  flows {
    title
  }
}

{
  course(id: "00000000-5945-95c7-65fc-a9747b20031d") {
    ...ReuseableFragment
  }
  anotherCourse: course(id: "00000000-5945-95c6-65fc-a9747b200320") {
    ...ReuseableFragment
  }
}
```

{% endtab %}

{% tab title="Without fragments" %}

```graphql
{
  course(id: "00000000-5945-95c7-65fc-a9747b20031d") {
    id
    title
    flows {
      title
    }
  }
  anotherCourse: course(id: "00000000-5945-95c6-65fc-a9747b200320") {
    id
    title
    flows {
      title
    }
  }
}
```

{% endtab %}

{% tab title="Results" %}

```javascript
{
  "data": {
    "course": {
      "id": "00000000-5945-95c6-65fc-a9747b200317",
      "title": "History 101",
      "flows": [
        {
          "title": "Welcome to History 101"
        },
        {
          "title": "Nascent Civilization"
        }
      ]
    },
    "anotherCourse": {
      "id": "00000000-5945-95c7-65fd-a9747b200320",
      "title": "M & A 101",
      "flows": [
        {
          "title": "Welcome to Mergers & Acquisitions 101"
        },
        {
          "title": "Flow 1 - SEC Regulatory Measures"
        },
        {
          "title": "Flow 2 - Intro"
        },
        {
          "title": "Flow 3 - Mergers"
        },
        {
          "title": "Flow 4 - Acquistions"
        },
        {
          "title": "Mergeable activities"
        }
      ]
    }
  }
}
```

{% endtab %}
{% endtabs %}

Another thing to point out: `anotherCourse` is a [GraphQL alias](https://graphql.org/learn/queries/#aliases). This is a way to make multiple queries to the same field (`query.course`)


---

# 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/fragments.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.
