# fileVersion

```graphql
query FileVersion($input: FileVersionInput!) {
  fileVersion(input: $input) {
    binary {
      contentHash
      byteSize
      contentType
    }
    id
    path
    content
    size
    sizeBytes
    type
    updatedAt
    fileId
    createdAt
    createdBy
  }
}
```

Return file version. Requires project.files.read.

## Arguments

| Name              | Type              | Required | Description                                                              |
| ----------------- | ----------------- | -------- | ------------------------------------------------------------------------ |
| `input`           | FileVersionInput! | Yes      |                                                                          |
| `input.filePath`  | String!           | Yes      |                                                                          |
| `input.versionId` | String!           | Yes      | Version UUID or index 0..99; zero is the newest committed version.       |
| `input.ref`       | String            |          | Main or branch:<name-or-id>. Release/environment history is unsupported. |
| `input.branch`    | String            |          |                                                                          |
| `input.branchId`  | String            |          |                                                                          |

## Variables

```json
{
  "input": {
    "filePath": "string",
    "versionId": "string"
  }
}
```

## Responses

| Status | Description                                  |
| ------ | -------------------------------------------- |
| 200    | The FileVersionContent! in data.fileVersion. |

## 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 FileVersion($input: FileVersionInput!) {\n  fileVersion(input: $input) {\n    binary {\n      contentHash\n      byteSize\n      contentType\n    }\n    id\n    path\n    content\n    size\n    sizeBytes\n    type\n    updatedAt\n    fileId\n    createdAt\n    createdBy\n  }\n}",
  "variables": {
    "input": {
      "filePath": "string",
      "versionId": "string"
    }
  }
}'
```

## Example response

```json
{
  "data": {
    "fileVersion": {
      "binary": {
        "contentHash": "string",
        "byteSize": 0,
        "contentType": "string"
      },
      "id": "string",
      "path": "string",
      "content": "string",
      "size": 0,
      "sizeBytes": 0,
      "type": "string",
      "updatedAt": "string",
      "fileId": "string",
      "createdAt": "string",
      "createdBy": "string"
    }
  }
}
```
