# Resolve graph

URL: https://docs.hanzo.ai/docs/openapi/graph/graphresolve

> Answers what holds for one entity and relation at a point, winner first, with every weaker account that disagreed.

`POST /v1/graph/resolve`

> [Graph →](https://docs.hanzo.ai/docs/openapi/graph) · [All API references →](https://docs.hanzo.ai/docs/openapi) · [Get started →](https://docs.hanzo.ai/docs/guides)

|               |                                         |
| ------------- | --------------------------------------- |
| **Address**   | `https://api.hanzo.ai/v1/graph/resolve` |
| **Method**    | `POST`                                  |
| **Operation** | `graphResolve`                          |
| **Auth**      | `Authorization: Bearer $HANZO_API_KEY`  |

Answers what holds for one entity and relation at a point, winner
first, with every weaker account that disagreed.

The winner is the holding statement begun most recently, then the strongest
under the rule vocabulary names. A relation that holds many values answers
each; a disagreement is reported as contested, never resolved into silence.

Time: as\_of is the instant of the world asked about and as\_known how much this
plane had heard; either absent is now.

## Request

4 fields, body `application/json` (required).

| Field      | In   | Type   | Required | Description                                                                                                                                      |
| ---------- | ---- | ------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| `as_known` | body | string | —        | AsKnown is how much this plane had heard, RFC 3339: the answer as it would have been given then, which is what makes a past answer reproducible. |
| `as_of`    | body | string | —        | AsOf is the instant of the world to answer about, RFC 3339: what held then.                                                                      |
| `entity`   | body | string | yes      | Entity is the thing to answer about.                                                                                                             |
| `relation` | body | string | yes      | Relation is the one relation to settle.                                                                                                          |

## Response

| Status    | Body                  | Meaning |
| --------- | --------------------- | ------- |
| `200`     | graph.graphResolveOut | ok      |
| `default` | problem-details       | refused |

`200` body — 49 fields.

| Field                    | In   | Type              | Always | Description                                                                                                                                                                                                                                          |
| ------------------------ | ---- | ----------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `as_known`               | body | string            | —      | AsKnown is the knowledge instant it was taken at, RFC 3339, the same way.                                                                                                                                                                            |
| `as_of`                  | body | string            | —      | AsOf is the valid instant this answer was taken at, RFC 3339: the one asked for, or the server's clock when none was.                                                                                                                                |
| `conflicts`              | body | graph.wireFact\[] | —      | Conflicts is, for a relation holding one value, every weaker account of the winner's moment that names a different value, strongest first.                                                                                                           |
| `conflicts[].at`         | body | string            | —      | At is when the thing was so, RFC 3339, as the asserter gave it.                                                                                                                                                                                      |
| `conflicts[].by`         | body | string            | —      | By is the identity that filed it — `owner` or `owner/user` — stamped from the validated principal at the write, never from the body.                                                                                                                 |
| `conflicts[].confidence` | body | number (double)   | —      | Confidence in \[0,1] as the asserter gave it; absent is 0.                                                                                                                                                                                           |
| `conflicts[].entity`     | body | string            | —      | Entity is the thing described, in the organization's own namespace.                                                                                                                                                                                  |
| `conflicts[].evidence`   | body | string            | —      | Evidence points at the record the claim came from.                                                                                                                                                                                                   |
| `conflicts[].id`         | body | string            | —      | ID is the assertion's content address, minted by the server from what was asserted.                                                                                                                                                                  |
| `conflicts[].knowable`   | body | string            | —      | Knowable is the first instant this plane could have answered with the assertion, RFC 3339: the later of Seen and the server's clock at the write.                                                                                                    |
| `conflicts[].names`      | body | boolean           | —      | Names true means the assertion is an edge and Value is an entity.                                                                                                                                                                                    |
| `conflicts[].relation`   | body | string            | —      | Relation is what was asserted of it.                                                                                                                                                                                                                 |
| `conflicts[].seen`       | body | string            | —      | Seen is when the asserter says it became knowable, RFC 3339.                                                                                                                                                                                         |
| `conflicts[].source`     | body | string            | —      | Source names who asserted, as the caller gave it.                                                                                                                                                                                                    |
| `conflicts[].until`      | body | string            | —      | Until is when the thing stopped being so, RFC 3339, as the asserter gave it.                                                                                                                                                                         |
| `conflicts[].value`      | body | string            | —      | Value is what the relation points at: another entity's key when Names is true, otherwise a scalar.                                                                                                                                                   |
| `contested`              | body | boolean           | —      | Contested is true exactly when Conflicts is not empty.                                                                                                                                                                                               |
| `entity`                 | body | string            | —      | Entity is the entity the question named, echoed so a stored answer still says what it is about.                                                                                                                                                      |
| `held`                   | body | graph.wireFact\[] | —      | Held is every statement holding at the point, Winner first, one per value: one for a relation that holds one value at a time, and every one the pair holds for a relation that holds many — the five holders of a position over five terms are five. |
| `held[].at`              | body | string            | —      | At is when the thing was so, RFC 3339, as the asserter gave it.                                                                                                                                                                                      |
| `held[].by`              | body | string            | —      | By is the identity that filed it — `owner` or `owner/user` — stamped from the validated principal at the write, never from the body.                                                                                                                 |
| `held[].confidence`      | body | number (double)   | —      | Confidence in \[0,1] as the asserter gave it; absent is 0.                                                                                                                                                                                           |
| `held[].entity`          | body | string            | —      | Entity is the thing described, in the organization's own namespace.                                                                                                                                                                                  |
| `held[].evidence`        | body | string            | —      | Evidence points at the record the claim came from.                                                                                                                                                                                                   |
| `held[].id`              | body | string            | —      | ID is the assertion's content address, minted by the server from what was asserted.                                                                                                                                                                  |
| `held[].knowable`        | body | string            | —      | Knowable is the first instant this plane could have answered with the assertion, RFC 3339: the later of Seen and the server's clock at the write.                                                                                                    |
| `held[].names`           | body | boolean           | —      | Names true means the assertion is an edge and Value is an entity.                                                                                                                                                                                    |
| `held[].relation`        | body | string            | —      | Relation is what was asserted of it.                                                                                                                                                                                                                 |
| `held[].seen`            | body | string            | —      | Seen is when the asserter says it became knowable, RFC 3339.                                                                                                                                                                                         |
| `held[].source`          | body | string            | —      | Source names who asserted, as the caller gave it.                                                                                                                                                                                                    |
| `held[].until`           | body | string            | —      | Until is when the thing stopped being so, RFC 3339, as the asserter gave it.                                                                                                                                                                         |
| `held[].value`           | body | string            | —      | Value is what the relation points at: another entity's key when Names is true, otherwise a scalar.                                                                                                                                                   |
| `known`                  | body | boolean           | —      | Known is false when nothing held at the point.                                                                                                                                                                                                       |
| `relation`               | body | string            | —      | Relation is the relation the question named, echoed for the same reason.                                                                                                                                                                             |
| `truncated`              | body | boolean           | —      | Truncated says this pair holds more statements than one read returns, so the answer was decided from the ceiling-full begun most recently.                                                                                                           |
| `winner`                 | body | graph.wireFact    | —      |                                                                                                                                                                                                                                                      |
| `winner.at`              | body | string            | —      | At is when the thing was so, RFC 3339, as the asserter gave it.                                                                                                                                                                                      |
| `winner.by`              | body | string            | —      | By is the identity that filed it — `owner` or `owner/user` — stamped from the validated principal at the write, never from the body.                                                                                                                 |
| `winner.confidence`      | body | number (double)   | —      | Confidence in \[0,1] as the asserter gave it; absent is 0.                                                                                                                                                                                           |
| `winner.entity`          | body | string            | —      | Entity is the thing described, in the organization's own namespace.                                                                                                                                                                                  |
| `winner.evidence`        | body | string            | —      | Evidence points at the record the claim came from.                                                                                                                                                                                                   |
| `winner.id`              | body | string            | —      | ID is the assertion's content address, minted by the server from what was asserted.                                                                                                                                                                  |
| `winner.knowable`        | body | string            | —      | Knowable is the first instant this plane could have answered with the assertion, RFC 3339: the later of Seen and the server's clock at the write.                                                                                                    |
| `winner.names`           | body | boolean           | —      | Names true means the assertion is an edge and Value is an entity.                                                                                                                                                                                    |
| `winner.relation`        | body | string            | —      | Relation is what was asserted of it.                                                                                                                                                                                                                 |
| `winner.seen`            | body | string            | —      | Seen is when the asserter says it became knowable, RFC 3339.                                                                                                                                                                                         |
| `winner.source`          | body | string            | —      | Source names who asserted, as the caller gave it.                                                                                                                                                                                                    |
| `winner.until`           | body | string            | —      | Until is when the thing stopped being so, RFC 3339, as the asserter gave it.                                                                                                                                                                         |
| `winner.value`           | body | string            | —      | Value is what the relation points at: another entity's key when Names is true, otherwise a scalar.                                                                                                                                                   |

Failure carries the platform error shape — see [Errors](https://docs.hanzo.ai/docs/errors).

## Examples

**CLI**

```bash
hanzo graph resolve
```

**SDK**

**.ts**

```ts
import { Configuration, GraphApi } from 'hanzoai';

const api = new GraphApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.graphResolve({ entity: "<entity>", relation: "<relation>" });
```

**.py**

```python
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import GraphApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = GraphApi(client).graph_resolve(entity="<entity>", relation="<relation>")
```

**.go**

```go
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.GraphAPI.GraphResolve(context.Background()).Execute()
if err != nil {
	return err
}
```

**.rs**

```rust
use hanzo_client::apis::{configuration::Configuration, graph_api};

let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();

let result = graph_api::graph_resolve(&cfg, Default::default()).await?;
```

**.java**

```java
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.GraphApi;

ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new GraphApi(client).graphResolve();
```

**HTTP**

```bash
curl -X POST https://api.hanzo.ai/v1/graph/resolve \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "entity": "<entity>",
       "relation": "<relation>"
     }'
```

**MCP**

Tool `graph`, op `graphResolve` — POST the JSON-RPC envelope to `https://api.hanzo.ai/v1/mcp`.

```bash
curl -X POST https://api.hanzo.ai/v1/mcp \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "jsonrpc": "2.0",
       "id": 1,
       "method": "tools/call",
       "params": {
         "name": "graph",
         "arguments": {
           "op": "graphResolve",
           "input": {
             "entity": "<entity>",
             "relation": "<relation>"
           }
         }
       }
     }'
```

---

[Graph API](https://docs.hanzo.ai/docs/openapi/graph) · [All Hanzo APIs](https://docs.hanzo.ai/docs/openapi) · [Interactive reference](https://docs.hanzo.ai/docs/openapi/reference)
