# draftFiles

```graphql
query DraftFiles($input: ListDraftFilesInput!) {
  draftFiles(input: $input) {
    entityId
    entityType
    bodySnapshot
    version
    updatedAt
  }
}
```

List draft files. Requires project.files.read.

## Arguments

| Name                     | Type                 | Required | Description                                                                                                                                              |
| ------------------------ | -------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `input`                  | ListDraftFilesInput! | Yes      |                                                                                                                                                          |
| `input.projectReference` | String               |          | Project whose pending drafts are selected. Returns one latest update per canonically visible source file; restricted server-function drafts are omitted. |
| `input.branchId`         | ID                   |          |                                                                                                                                                          |
| `input.entityType`       | DraftEntityType      |          | Filter pending drafts by their actual source-file type. One of `page`, `component`, `function`, `virtual_file`.                                          |
| `input.branchReference`  | String               |          | Branch name or UUID. Conflicting branchId aliases are rejected; omit/null for main.                                                                      |

## Variables

```json
{
  "input": {}
}
```

## Responses

| Status | Description                            |
| ------ | -------------------------------------- |
| 200    | The \[DraftFile!]! in data.draftFiles. |

## 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 DraftFiles($input: ListDraftFilesInput!) {\n  draftFiles(input: $input) {\n    entityId\n    entityType\n    bodySnapshot\n    version\n    updatedAt\n  }\n}",
  "variables": {
    "input": {}
  }
}'
```

## Example response

```json
{
  "data": {
    "draftFiles": [
      {
        "entityId": "string",
        "entityType": "page",
        "bodySnapshot": "string",
        "version": 0,
        "updatedAt": "2026-01-01T00:00:00Z"
      }
    ]
  }
}
```
