Get files

fileContents(input: FileContentsInput!): FileBatch!

Requires project.files.read.

Arguments

ArgumentTypeRequired
inputFileContentsInput!Yes

Input fields

input

FileContentsInput

FieldTypeRequiredDescription
projectReferenceStringNoProject UUID, slug or configured domain. Omit it to use the project of the request.
refStringNoContent to read: main, branch:<name-or-id>, release:<version> or env:<name>. Omit for main.
paths[String!]!YesExact file paths to read. Results keep this order.

Response

Returns FileBatch!. Open the type for its fields and nested types.

FieldType
data[FileBatchEntry!]!

Types marked with ! cannot be null. Lists use [Type] notation. The type index lists all published input and response types.

Example

query.graphql
query FileContents($input: FileContentsInput!) {  fileContents(input: $input) {    data {      found      path    }  }}
variables.json
{  "input": {    "projectReference": "00000000-0000-4000-8000-000000000001",    "paths": []  }}