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

# Get file

> Return a file.

`file(input: FileInput!): File!`

Requires project.files.read.

## Arguments

| Argument | Type | Required |
| - | - | - |
| `input` | [`FileInput!`](https://veryfront.com/docs/cloud/graphql/types/fileinput) | Yes |

## Input fields

### input

[`FileInput`](https://veryfront.com/docs/cloud/graphql/types/fileinput)

| Field | Type | Required | Description |
| - | - | - | - |
| `projectReference` | [`String`](https://veryfront.com/docs/cloud/graphql/types/string) | No | Project UUID, slug or configured domain. Omit it to use the project of the request. |
| `filePath` | [`String!`](https://veryfront.com/docs/cloud/graphql/types/string) | Yes | Project-relative source path, or the file ID. |
| `ref` | [`String`](https://veryfront.com/docs/cloud/graphql/types/string) | No | Content to read: main, branch:\<name-or-id>, release:\<version> or env:\<name>. Omit for main. |

## Response

Returns [`File!`](https://veryfront.com/docs/cloud/graphql/types/file). Open the type for its fields and nested types.

| Field | Type | Description |
| - | - | - |
| `binary` | [`BinaryCompanionDescriptor`](https://veryfront.com/docs/cloud/graphql/types/binarycompaniondescriptor) | |
| `id` | [`ID!`](https://veryfront.com/docs/cloud/graphql/types/id) | |
| `versionId` | [`String`](https://veryfront.com/docs/cloud/graphql/types/string) | |
| `path` | [`String!`](https://veryfront.com/docs/cloud/graphql/types/string) | |
| `type` | [`String!`](https://veryfront.com/docs/cloud/graphql/types/string) | |
| `size` | [`Int`](https://veryfront.com/docs/cloud/graphql/types/int) | Size of the content in bytes; the same value as sizeBytes. |
| `sizeBytes` | [`Int`](https://veryfront.com/docs/cloud/graphql/types/int) | Size of the content encoded as UTF-8, in bytes. |
| `content` | [`String`](https://veryfront.com/docs/cloud/graphql/types/string) | Full text content. Listings read it only when a query selects it. |

[All fields of `File`](https://veryfront.com/docs/cloud/graphql/types/file).

Types marked with `!` cannot be null. Lists use `[Type]` notation. The [type index](https://veryfront.com/docs/cloud/graphql/schema.md) lists all published input and response types.

## Example

```graphql title="query.graphql" theme={null}
query File($input: FileInput!) {
  file(input: $input) {
    id
    createdAt
    updatedAt
    checksum
    content
  }
}
```

```json title="variables.json" theme={null}
{
  "input": {
    "projectReference": "00000000-0000-4000-8000-000000000001",
    "filePath": "example"
  }
}
```

<details>
  <summary>Try this query</summary>

  Calls use `https://api.veryfront.com/graphql`. Replace sample values with resources you can access. See [Authentication](https://veryfront.com/docs/cloud/authentication.md) for credentials and permissions.

  Bearer token or API key

  Stored in this tab's session. Clear credential

  Query

  Variables (JSON)
</details>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.