# eval

```graphql
query Eval($projectReference: String!, $evalId: String!) {
  eval(projectReference: $projectReference, evalId: $evalId) {
    id
    name
    description
    targetKind
    target
    sourcePath
    exportName
    dataset {
      kind
      path
      editable
      dynamic
    }
    metrics {
      name
      family
      severity
      config
      editable
      dynamic
    }
    repetitions
    tags
    metadata
    editableFields
    dynamicFields
    capabilities
  }
}
```

Read one eval definition by its ID to inspect its target, dataset, metrics and the fields that can be edited; returns the eval. Requires project.evals.read.

## Arguments

| Name                        | Type                | Required | Description                                                                                                                    |
| --------------------------- | ------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------ |
| `projectReference`          | String!             | Yes      |                                                                                                                                |
| `evalId`                    | String!             | Yes      |                                                                                                                                |
| `input`                     | SourceSelectorInput |          |                                                                                                                                |
| `input.sourceTargetKind`    | SourceTargetKind    |          | The source to read; default runtimeTargetKind, else project. One of `project`, `main_branch`, `environment`, `preview_branch`. |
| `input.runtimeTargetKind`   | RuntimeTargetKind   |          | Used as the source to read when sourceTargetKind is omitted. One of `main_branch`, `environment`, `preview_branch`.            |
| `input.targetEnvironmentId` | ID                  |          | Required with the kind environment.                                                                                            |
| `input.targetBranchId`      | ID                  |          | Required with the kind preview\_branch.                                                                                        |

## Variables

```json
{
  "projectReference": "string",
  "evalId": "string"
}
```

## Responses

| Status | Description             |
| ------ | ----------------------- |
| 200    | The Eval! in data.eval. |

## Call it

```bash
curl -X POST "https://api.veryfront.com/graphql" \
  -H "Authorization: Bearer $VERYFRONT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "query": "query Eval($projectReference: String!, $evalId: String!) {\n  eval(projectReference: $projectReference, evalId: $evalId) {\n    id\n    name\n    description\n    targetKind\n    target\n    sourcePath\n    exportName\n    dataset {\n      kind\n      path\n      editable\n      dynamic\n    }\n    metrics {\n      name\n      family\n      severity\n      config\n      editable\n      dynamic\n    }\n    repetitions\n    tags\n    metadata\n    editableFields\n    dynamicFields\n    capabilities\n  }\n}",
  "variables": {
    "projectReference": "string",
    "evalId": "string"
  }
}'
```

## Example response

```json
{
  "data": {
    "eval": {
      "id": "string",
      "name": "string",
      "description": "string",
      "targetKind": "agent",
      "target": "string",
      "sourcePath": "string",
      "exportName": "string",
      "dataset": {
        "kind": "inline",
        "path": "string",
        "editable": false,
        "dynamic": false
      },
      "metrics": [
        {
          "name": "string",
          "family": "answer",
          "severity": "gate",
          "config": {},
          "editable": false,
          "dynamic": false
        }
      ],
      "repetitions": 0,
      "tags": [
        "string"
      ],
      "metadata": {},
      "editableFields": [
        "name"
      ],
      "dynamicFields": [
        "name"
      ],
      "capabilities": [
        "string"
      ]
    }
  }
}
```
