List file versions

fileVersions(input: FileVersionsInput!): FileVersionsPayload!

Requires project.files.read.

Arguments

ArgumentTypeRequired
inputFileVersionsInput!Yes

Input fields

input

FileVersionsInput

FieldTypeRequiredDescription
filePathString!Yes
refStringNoMain or branch:<name-or-id>. Release/environment history is unsupported.
branchStringNoBranch name or ID alias for ref. Supplied aliases must agree.
branchIdStringNoBranch UUID alias for ref. Supplied aliases must agree.
cursorStringNoOpaque endCursor returned by the preceding page.
limitIntNoMaximum committed versions, 1..100 (default: 20).

Response

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

FieldTypeDescription
data[ProjectFileVersion!]!Committed file versions newest first: main uses selection time and branches use commit sequence.
pageInfoPageInfo!Forward-only pagination. hasPreviousPage is true when the page was requested with a cursor; endCursor continues to the next page.

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

Example

graphql
query FileVersions($input: FileVersionsInput!) {
  fileVersions(input: $input) {
    data {
      id
      createdAt
      createdBy
      fileId
      path
    }
    pageInfo {
      hasNextPage
      endCursor
      hasPreviousPage
      startCursor
    }
  }
}
json
{
  "input": {
    "filePath": "example"
  }
}