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

# Hexagraph GraphQL Queries: output, outputs, and author

> Full reference for Hexagraph GraphQL queries: output(id), outputs(query), and author(id). Includes arguments, return fields, and complete query examples.

This page documents every query available in the Hexagraph GraphQL API with their arguments, return types, and complete usage examples. All queries are sent as `POST` requests to `https://api.hexagraph.in/graphql`.

<Note>
  All IDs passed to GraphQL queries must use the full `HX_` prefix format — for example, `HX_W2107277218` for a work or `HX_A5086208034` for an author. Bare numeric IDs are not accepted.
</Note>

***

## `output(id)`

Fetches a single scholarly work by its unique identifier.

### Arguments

<ParamField query="id" type="String!" required>
  The `HX_W`-prefixed identifier of the scholarly work. Example: `"HX_W2107277218"`.
</ParamField>

### Return Fields

| Field       | Type       | Description                                               |
| ----------- | ---------- | --------------------------------------------------------- |
| `id`        | `String`   | The HX\_W identifier for this work                        |
| `doi`       | `String`   | Digital Object Identifier (DOI), if available             |
| `title`     | `String`   | Full title of the work                                    |
| `year`      | `Int`      | Publication year                                          |
| `date`      | `String`   | Full publication date                                     |
| `citations` | `Int`      | Total citation count                                      |
| `source`    | `String`   | Name of the publication venue (journal, conference, etc.) |
| `authors`   | `[Author]` | List of authors; each has a `name` field                  |

### Example Query

```graphql theme={null}
query GetScholarlyOutput {
  output(id: "HX_W2107277218") {
    id
    doi
    title
    year
    date
    citations
    source
    authors {
      name
    }
  }
}
```

### Example Response

```json theme={null}
{
  "data": {
    "output": {
      "id": "HX_W2107277218",
      "doi": "https://doi.org/10.1038/nature12373",
      "title": "Quantifying the evolution of individual scientific impact",
      "year": 2013,
      "date": "2013-11-07",
      "citations": 892,
      "source": "Nature",
      "authors": [
        { "name": "Roberta Sinatra" },
        { "name": "Dashun Wang" },
        { "name": "Pierre Deville" },
        { "name": "Chaoming Song" },
        { "name": "Albert-László Barabási" }
      ]
    }
  }
}
```

***

## `outputs(query)`

Searches and filters the Hexagraph works index. Supports full-text search, structured filter expressions, and pagination.

### Arguments

<ParamField query="query" type="Object" required>
  A query configuration object. All subfields are optional.

  <Expandable title="query subfields">
    <ParamField query="search" type="String">
      Full-text search term applied across titles, abstracts, and metadata. Example: `"artificial intelligence"`.
    </ParamField>

    <ParamField query="filter" type="String">
      A filter expression to narrow results. Example: `"has_doi:true"`. Multiple filters can be combined using comma separation.
    </ParamField>

    <ParamField query="page" type="Int">
      Page number for paginated results. Defaults to `1`.
    </ParamField>

    <ParamField query="per_page" type="Int">
      Number of results to return per page. Defaults to `25`.
    </ParamField>
  </Expandable>
</ParamField>

### Return Fields

Returns an array of output objects. Each object supports the same fields as `output(id)`, plus `affiliations` on nested author objects:

| Field                    | Type       | Description                                       |
| ------------------------ | ---------- | ------------------------------------------------- |
| `id`                     | `String`   | The HX\_W identifier                              |
| `doi`                    | `String`   | DOI, if available                                 |
| `title`                  | `String`   | Full title                                        |
| `date`                   | `String`   | Publication date                                  |
| `source`                 | `String`   | Publication venue                                 |
| `citations`              | `Int`      | Citation count                                    |
| `authors[].name`         | `String`   | Author name                                       |
| `authors[].affiliations` | `[String]` | List of institutional affiliations for the author |

### Example Query

```graphql theme={null}
query SearchPublications {
  outputs(query: {
    search: "artificial intelligence"
    filter: "has_doi:true"
    page: 1
    per_page: 3
  }) {
    id
    doi
    title
    date
    source
    citations
    authors {
      name
      affiliations
    }
  }
}
```

### Example Response

```json theme={null}
{
  "data": {
    "outputs": [
      {
        "id": "HX_W3128349626",
        "doi": "https://doi.org/10.1126/science.abb8662",
        "title": "Artificial intelligence and the future of work",
        "date": "2021-03-12",
        "source": "Science",
        "citations": 411,
        "authors": [
          {
            "name": "Erik Brynjolfsson",
            "affiliations": ["Stanford University"]
          }
        ]
      }
    ]
  }
}
```

***

## `author(id)`

Fetches a researcher's profile by their unique author identifier.

### Arguments

<ParamField query="id" type="String!" required>
  The `HX_A`-prefixed identifier of the author. Example: `"HX_A5086208034"`.
</ParamField>

### Return Fields

| Field          | Type            | Description                                                                                   |
| -------------- | --------------- | --------------------------------------------------------------------------------------------- |
| `id`           | `String`        | The HX\_A identifier for this author                                                          |
| `orcid`        | `String`        | ORCID iD, if available                                                                        |
| `name`         | `String`        | Author's display name                                                                         |
| `citations`    | `Int`           | Total citation count across all works                                                         |
| `outputs`      | `Int`           | Total number of indexed works                                                                 |
| `affiliations` | `[Affiliation]` | List of institutional affiliations; each contains an `institution` object with a `name` field |

### Example Query

```graphql theme={null}
query GetAuthorProfile {
  author(id: "HX_A5086208034") {
    id
    orcid
    name
    citations
    outputs
    affiliations {
      institution {
        name
      }
    }
  }
}
```

### Example Response

```json theme={null}
{
  "data": {
    "author": {
      "id": "HX_A5086208034",
      "orcid": "https://orcid.org/0000-0002-0299-3274",
      "name": "Albert-László Barabási",
      "citations": 142389,
      "outputs": 412,
      "affiliations": [
        {
          "institution": {
            "name": "Northeastern University"
          }
        },
        {
          "institution": {
            "name": "Harvard Medical School"
          }
        }
      ]
    }
  }
}
```

***

## Batching Multiple Queries

GraphQL allows you to combine multiple top-level queries into a single request. The example below fetches a work and an author profile simultaneously:

```graphql theme={null}
query BatchLookup {
  output(id: "HX_W2107277218") {
    id
    title
    year
  }
  author(id: "HX_A5086208034") {
    id
    name
    citations
  }
}
```

### Example Response

```json theme={null}
{
  "data": {
    "output": {
      "id": "HX_W2107277218",
      "title": "Quantifying the evolution of individual scientific impact",
      "year": 2013
    },
    "author": {
      "id": "HX_A5086208034",
      "name": "Albert-László Barabási",
      "citations": 142389
    }
  }
}
```

This single request counts as **one request** against the [rate limit](/api-reference/graphql/overview#rate-limits) (30 req/min, 1,000/day), regardless of how many entity lookups are included. Batching is the recommended pattern whenever your application needs data about multiple entities at the same time.
