Git

Reference documentation for GraphQL schema types in the Git category.

Blame - object

Represents a Git blame.

Fields for Blame

BlameRange - object

Represents a range of information from a Git blame.

Fields for BlameRange

Blob - object

Represents a Git blob.

Implements: GitObject, Node

Fields for Blob

CommittableBranch - input object

A git ref for a commit to be appended to.
The ref must be a branch, i.e. its fully qualified name must start
with refs/heads/ (although the input is not required to be fully
qualified).
The Ref may be specified by its global node ID or by the
repositoryNameWithOwner and branchName.
Examples
Specify a branch using a global node ID:
{ "id": "MDM6UmVmMTpyZWZzL2hlYWRzL21haW4=" }

Specify a branch using repositoryNameWithOwner and branchName:
{
"repositoryNameWithOwner": "github/graphql-client",
"branchName": "main"
}.

Input fields for CommittableBranch

createRef - mutation

Create a new Git Ref.

Input fields for createRef

Return fields for createRef

CreateRefInput - input object

Autogenerated input type of CreateRef.

Input fields for CreateRefInput

deleteRef - mutation

Delete a Git Ref.

Input fields for deleteRef

Return fields for deleteRef

DeleteRefInput - input object

Autogenerated input type of DeleteRef.

Input fields for DeleteRefInput

FileAddition - input object

A command to add a file at the given path with the given contents as part of a
commit. Any existing file at that that path will be replaced.

Input fields for FileAddition

FileChanges - input object

A description of a set of changes to a file tree to be made as part of
a git commit, modeled as zero or more file additions and zero or more
file deletions.
Both fields are optional; omitting both will produce a commit with no
file changes.
deletions and additions describe changes to files identified
by their path in the git tree using unix-style path separators, i.e.
/. The root of a git tree is an empty string, so paths are not
slash-prefixed.
path values must be unique across all additions and deletions
provided. Any duplication will result in a validation error.
Encoding
File contents must be provided in full for each FileAddition.
The contents of a FileAddition must be encoded using RFC 4648
compliant base64, i.e. correct padding is required and no characters
outside the standard alphabet may be used. Invalid base64
encoding will be rejected with a validation error.
The encoded contents may be binary.
For text files, no assumptions are made about the character encoding of
the file contents (after base64 decoding). No charset transcoding or
line-ending normalization will be performed; it is the client's
responsibility to manage the character encoding of files they provide.
However, for maximum compatibility we recommend using UTF-8 encoding
and ensuring that all files in a repository use a consistent
line-ending convention (\n or \r\n), and that all files end
with a newline.
Modeling file changes
Each of the the five types of conceptual changes that can be made in a
git commit can be described using the FileChanges type as follows:

New file addition: create file hello world\n at path docs/README.txt:
{
"additions" [
{
"path": "docs/README.txt",
"contents": base64encode("hello world\n")
}
]
}

Existing file modification: change existing docs/README.txt to have new
content new content here\n:
{
"additions" [
{
"path": "docs/README.txt",
"contents": base64encode("new content here\n")
}
]
}

Existing file deletion: remove existing file docs/README.txt.
Note that the path is required to exist -- specifying a
path that does not exist on the given branch will abort the
commit and return an error.
{
"deletions" [
{
"path": "docs/README.txt"
}
]
}

File rename with no changes: rename docs/README.txt with
previous content hello world\n to the same content at
newdocs/README.txt:
{
"deletions" [
{
"path": "docs/README.txt",
}
],
"additions" [
{
"path": "newdocs/README.txt",
"contents": base64encode("hello world\n")
}
]
}

File rename with changes: rename docs/README.txt with
previous content hello world\n to a file at path
newdocs/README.txt with content new contents\n:
{
"deletions" [
{
"path": "docs/README.txt",
}
],
"additions" [
{
"path": "newdocs/README.txt",
"contents": base64encode("new contents\n")
}
]
}.

Input fields for FileChanges

FileDeletion - input object

A command to delete the file at the given path as part of a commit.

Input fields for FileDeletion

GitActor - object

Represents an actor in a Git commit (ie. an author or committer).

Fields for GitActor

GitActorConnection - object

The connection type for GitActor.

Fields for GitActorConnection

GitActorEdge - object

An edge in a connection.

Fields for GitActorEdge

GitObject - interface

Represents a Git object.

Fields for GitObject

Implemented by

GitSignature - interface

Information about a signature (GPG or S/MIME) on a Commit or Tag.

Fields for GitSignature

Implemented by

GitSignatureState - enum

The state of a Git signature.

Values for GitSignatureState

GpgSignature - object

Represents a GPG signature on a Commit or Tag.

Implements: GitSignature

Fields for GpgSignature

Push - object

A Git push.

Implements: Node

Fields for Push

Ref - object

Represents a Git reference.

Implements: Node

Fields for Ref

RefConnection - object

The connection type for Ref.

Fields for RefConnection

RefEdge - object

An edge in a connection.

Fields for RefEdge

RefOrder - input object

Ways in which lists of git refs can be ordered upon return.

Input fields for RefOrder

RefOrderField - enum

Properties by which ref connections can be ordered.

Values for RefOrderField

RefUpdate - input object

A ref update.

Input fields for RefUpdate

RefUpdateRule - object

Branch protection rules that are enforced on the viewer.

Fields for RefUpdateRule

SmimeSignature - object

Represents an S/MIME signature on a Commit or Tag.

Implements: GitSignature

Fields for SmimeSignature

SshSignature - object

Represents an SSH signature on a Commit or Tag.

Implements: GitSignature

Fields for SshSignature

Submodule - object

A pointer to a repository at a specific revision embedded inside another repository.

Fields for Submodule

SubmoduleConnection - object

The connection type for Submodule.

Fields for SubmoduleConnection

SubmoduleEdge - object

An edge in a connection.

Fields for SubmoduleEdge

Tag - object

Represents a Git tag.

Implements: GitObject, Node

Fields for Tag

Tree - object

Represents a Git tree.

Implements: GitObject, Node

Fields for Tree

TreeEntry - object

Represents a Git tree entry.

Fields for TreeEntry

UnknownSignature - object

Represents an unknown signature on a Commit or Tag.

Implements: GitSignature

Fields for UnknownSignature

updateRef - mutation

Update a Git Ref.

Input fields for updateRef

Return fields for updateRef

UpdateRefInput - input object

Autogenerated input type of UpdateRef.

Input fields for UpdateRefInput

updateRefs - mutation

Creates, updates and/or deletes multiple refs in a repository.
This mutation takes a list of RefUpdates and performs these updates
on the repository. All updates are performed atomically, meaning that
if one of them is rejected, no other ref will be modified.
RefUpdate.beforeOid specifies that the given reference needs to point
to the given value before performing any updates. A value of
0000000000000000000000000000000000000000 can be used to verify that
the references should not exist.
RefUpdate.afterOid specifies the value that the given reference
will point to after performing all updates. A value of
0000000000000000000000000000000000000000 can be used to delete a
reference.
If RefUpdate.force is set to true, a non-fast-forward updates
for the given reference will be allowed.

Input fields for updateRefs

Return fields for updateRefs

UpdateRefsInput - input object

Autogenerated input type of UpdateRefs.

Input fields for UpdateRefsInput