Mutations
createRef
Create a new Git Ref.
Campos de entrada para createRef
input(CreateRefInput!)
Campos de retorno para createRef
| Nombre | Descripción |
|---|---|
| A unique identifier for the client performing the mutation. |
| The newly created ref. |
deleteRef
Delete a Git Ref.
Campos de entrada para deleteRef
input(DeleteRefInput!)
Campos de retorno para deleteRef
| Nombre | Descripción |
|---|---|
| A unique identifier for the client performing the mutation. |
updateRef
Update a Git Ref.
Campos de entrada para updateRef
input(UpdateRefInput!)
Campos de retorno para updateRef
| Nombre | Descripción |
|---|---|
| A unique identifier for the client performing the mutation. |
| The updated Ref. |
updateRefs
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.
Campos de entrada para updateRefs
input(UpdateRefsInput!)
Campos de retorno para updateRefs
| Nombre | Descripción |
|---|---|
| A unique identifier for the client performing the mutation. |
Objects
Blame
Represents a Git blame.
Campos para Blame
| Nombre | Descripción |
|---|---|
| The list of ranges from a Git blame. |
BlameRange
Represents a range of information from a Git blame.
Campos para BlameRange
| Nombre | Descripción |
|---|---|
| Identifies the recency of the change, from 1 (new) to 10 (old). This is calculated as a 2-quantile and determines the length of distance between the median age of all the changes in the file and the recency of the current range's change. |
| Identifies the line author. |
| The ending line for the range. |
| The starting line for the range. |
Blob
Represents a Git blob.
Blob Implementa
Campos para Blob
| Nombre | Descripción |
|---|---|
| An abbreviated version of the Git object ID. |
| Byte size of Blob object. |
| The HTTP path for this Git object. |
| The HTTP URL for this Git object. |
| The Node ID of the Blob object. |
| Indicates whether the Blob is binary or text. Returns null if unable to determine the encoding. |
| Indicates whether the contents is truncated. |
| The Git object ID. |
| The Repository the Git object belongs to. |
| UTF8 text data or null if the Blob is binary. |
GitActor
Represents an actor in a Git commit (ie. an author or committer).
Campos para GitActor
| Nombre | Descripción |
|---|---|
| A URL pointing to the author's public avatar. Argumentos para
|
| The timestamp of the Git action (authoring or committing). |
| The email in the Git commit. |
| The name in the Git commit. |
| The GitHub user corresponding to the email field. Null if no such user exists. |
GitActorConnection
The connection type for GitActor.
Campos para GitActorConnection
| Nombre | Descripción |
|---|---|
| A list of edges. |
| A list of nodes. |
| Information to aid in pagination. |
| Identifies the total count of items in the connection. |
GitActorEdge
An edge in a connection.
Campos para GitActorEdge
| Nombre | Descripción |
|---|---|
| A cursor for use in pagination. |
| The item at the end of the edge. |
GpgSignature
Represents a GPG signature on a Commit or Tag.
GpgSignature Implementa
Campos para GpgSignature
| Nombre | Descripción |
|---|---|
| Email used to sign this object. |
| True if the signature is valid and verified by GitHub. |
| Hex-encoded ID of the key that signed this object. |
| Payload for GPG signing object. Raw ODB object without the signature header. |
| ASCII-armored signature header from object. |
| GitHub user corresponding to the email signing this commit. |
| The state of this signature. |
| The date the signature was verified, if valid. |
| True if the signature was made with GitHub's signing key. |
Push
A Git push.
Push Implementa
Campos para Push
| Nombre | Descripción |
|---|---|
| The Node ID of the Push object. |
| The SHA after the push. |
| The permalink for this push. |
| The SHA before the push. |
| The actor who pushed. |
| The repository that was pushed to. |
Ref
Represents a Git reference.
Ref Implementa
Campos para Ref
| Nombre | Descripción |
|---|---|
| A list of pull requests with this ref as the head ref. Argumentos para
|
| Branch protection rules for this ref. |
| Compares the current ref as a base ref to another head ref, if the comparison can be made. Argumentos para
|
| The Node ID of the Ref object. |
| The ref name. |
| The ref's prefix, such as |
| Branch protection rules that are viewable by non-admins. |
| The repository the ref belongs to. |
| A list of rules from active Repository and Organization rulesets that apply to this ref. Argumentos para
|
| The object the ref points to. Returns null when object does not exist. |
RefConnection
The connection type for Ref.
Campos para RefConnection
| Nombre | Descripción |
|---|---|
| A list of edges. |
| A list of nodes. |
| Information to aid in pagination. |
| Identifies the total count of items in the connection. |
RefEdge
An edge in a connection.
Campos para RefEdge
| Nombre | Descripción |
|---|---|
| A cursor for use in pagination. |
| The item at the end of the edge. |
RefUpdateRule
Branch protection rules that are enforced on the viewer.
Campos para RefUpdateRule
| Nombre | Descripción |
|---|---|
| Can this branch be deleted. |
| Are force pushes allowed on this branch. |
| Can matching branches be created. |
| Identifies the protection rule pattern. |
| Number of approving reviews required to update matching branches. |
| List of required status check contexts that must pass for commits to be accepted to matching branches. |
| Are reviews from code owners required to update matching branches. |
| Are conversations required to be resolved before merging. |
| Are merge commits prohibited from being pushed to this branch. |
| Are commits required to be signed. |
| Is the viewer allowed to dismiss reviews. |
| Can the viewer push to the branch. |
SmimeSignature
Represents an S/MIME signature on a Commit or Tag.
SmimeSignature Implementa
Campos para SmimeSignature
| Nombre | Descripción |
|---|---|
| Email used to sign this object. |
| True if the signature is valid and verified by GitHub. |
| Payload for GPG signing object. Raw ODB object without the signature header. |
| ASCII-armored signature header from object. |
| GitHub user corresponding to the email signing this commit. |
| The state of this signature. |
| The date the signature was verified, if valid. |
| True if the signature was made with GitHub's signing key. |
SshSignature
Represents an SSH signature on a Commit or Tag.
SshSignature Implementa
Campos para SshSignature
| Nombre | Descripción |
|---|---|
| Email used to sign this object. |
| True if the signature is valid and verified by GitHub. |
| Hex-encoded fingerprint of the key that signed this object. |
| Payload for GPG signing object. Raw ODB object without the signature header. |
| ASCII-armored signature header from object. |
| GitHub user corresponding to the email signing this commit. |
| The state of this signature. |
| The date the signature was verified, if valid. |
| True if the signature was made with GitHub's signing key. |
Submodule
A pointer to a repository at a specific revision embedded inside another repository.
Campos para Submodule
| Nombre | Descripción |
|---|---|
| The branch of the upstream submodule for tracking updates. |
| The git URL of the submodule repository. |
| The name of the submodule in .gitmodules. |
| The name of the submodule in .gitmodules (Base64-encoded). |
| The path in the superproject that this submodule is located in. |
| The path in the superproject that this submodule is located in (Base64-encoded). |
| The commit revision of the subproject repository being tracked by the submodule. |
SubmoduleConnection
The connection type for Submodule.
Campos para SubmoduleConnection
| Nombre | Descripción |
|---|---|
| A list of edges. |
| A list of nodes. |
| Information to aid in pagination. |
| Identifies the total count of items in the connection. |
SubmoduleEdge
An edge in a connection.
Campos para SubmoduleEdge
| Nombre | Descripción |
|---|---|
| A cursor for use in pagination. |
| The item at the end of the edge. |
Tag
Represents a Git tag.
Tag Implementa
Campos para Tag
| Nombre | Descripción |
|---|---|
| An abbreviated version of the Git object ID. |
| The HTTP path for this Git object. |
| The HTTP URL for this Git object. |
| The Node ID of the Tag object. |
| The Git tag message. |
| The Git tag name. |
| The Git object ID. |
| The Repository the Git object belongs to. |
| Details about the tag author. |
| The Git object the tag points to. |
Tree
Represents a Git tree.
Tree Implementa
Campos para Tree
| Nombre | Descripción |
|---|---|
| An abbreviated version of the Git object ID. |
| The HTTP path for this Git object. |
| The HTTP URL for this Git object. |
| A list of tree entries. |
| The Node ID of the Tree object. |
| The Git object ID. |
| The Repository the Git object belongs to. |
TreeEntry
Represents a Git tree entry.
Campos para TreeEntry
| Nombre | Descripción |
|---|---|
| The extension of the file. |
| Whether or not this tree entry is generated. |
| The programming language this file is written in. |
| Number of lines in the file. |
| Entry file mode. |
| Entry file name. |
| Entry file name. (Base64-encoded). |
| Entry file object. |
| Entry file Git object ID. |
| The full path of the file. |
| The full path of the file. (Base64-encoded). |
| The Repository the tree entry belongs to. |
| Entry byte size. |
| If the TreeEntry is for a directory occupied by a submodule project, this returns the corresponding submodule. |
| Entry file type. |
UnknownSignature
Represents an unknown signature on a Commit or Tag.
UnknownSignature Implementa
Campos para UnknownSignature
| Nombre | Descripción |
|---|---|
| Email used to sign this object. |
| True if the signature is valid and verified by GitHub. |
| Payload for GPG signing object. Raw ODB object without the signature header. |
| ASCII-armored signature header from object. |
| GitHub user corresponding to the email signing this commit. |
| The state of this signature. |
| The date the signature was verified, if valid. |
| True if the signature was made with GitHub's signing key. |
Interfaces
GitObject
Represents a Git object.
GitObject se implementa mediante
Campos para GitObject
| Nombre | Descripción |
|---|---|
| An abbreviated version of the Git object ID. |
| The HTTP path for this Git object. |
| The HTTP URL for this Git object. |
| The Node ID of the GitObject object. |
| The Git object ID. |
| The Repository the Git object belongs to. |
GitSignature
Information about a signature (GPG or S/MIME) on a Commit or Tag.
GitSignature se implementa mediante
Campos para GitSignature
| Nombre | Descripción |
|---|---|
| Email used to sign this object. |
| True if the signature is valid and verified by GitHub. |
| Payload for GPG signing object. Raw ODB object without the signature header. |
| ASCII-armored signature header from object. |
| GitHub user corresponding to the email signing this commit. |
| The state of this signature. |
| The date the signature was verified, if valid. |
| True if the signature was made with GitHub's signing key. |
Enums
GitSignatureState
The state of a Git signature.
Valores de GitSignatureState.
| Nombre | Descripción |
|---|---|
BAD_CERT | The signing certificate or its chain could not be verified. |
BAD_EMAIL | Invalid email used for signing. |
EXPIRED_KEY | Signing key expired. |
GPGVERIFY_ERROR | Internal error - the GPG verification service misbehaved. |
GPGVERIFY_UNAVAILABLE | Internal error - the GPG verification service is unavailable at the moment. |
INVALID | Invalid signature. |
MALFORMED_SIG | Malformed signature. |
NOT_SIGNING_KEY | The usage flags for the key that signed this don't allow signing. |
NO_USER | Email used for signing not known to GitHub. |
OCSP_ERROR | Valid signature, though certificate revocation check failed. |
OCSP_PENDING | Valid signature, pending certificate revocation checking. |
OCSP_REVOKED | One or more certificates in chain has been revoked. |
UNKNOWN_KEY | Key used for signing not known to GitHub. |
UNKNOWN_SIG_TYPE | Unknown signature type. |
UNSIGNED | Unsigned. |
UNVERIFIED_EMAIL | Email used for signing unverified on GitHub. |
VALID | Valid signature and verified by GitHub. |
RefOrderField
Properties by which ref connections can be ordered.
Valores de RefOrderField.
| Nombre | Descripción |
|---|---|
ALPHABETICAL | Order refs by their alphanumeric name. |
TAG_COMMIT_DATE | Order refs by underlying commit date if the ref prefix is refs/tags/. |
Input objects
CommittableBranch
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"
}.
Campos de entrada para CommittableBranch
| Nombre | Descripción |
|---|---|
| The unqualified name of the branch to append the commit to. |
| The Node ID of the Ref to be updated. |
| The nameWithOwner of the repository to commit to. |
CreateRefInput
Autogenerated input type of CreateRef.
Campos de entrada para CreateRefInput
| Nombre | Descripción |
|---|---|
| A unique identifier for the client performing the mutation. |
| The fully qualified name of the new Ref (ie: |
| The GitObjectID that the new Ref shall target. Must point to a commit. |
| The Node ID of the Repository to create the Ref in. |
DeleteRefInput
Autogenerated input type of DeleteRef.
Campos de entrada para DeleteRefInput
| Nombre | Descripción |
|---|---|
| A unique identifier for the client performing the mutation. |
| The Node ID of the Ref to be deleted. |
FileAddition
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.
Campos de entrada para FileAddition
| Nombre | Descripción |
|---|---|
| The base64 encoded contents of the file. |
| The path in the repository where the file will be located. |
FileChanges
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\nat pathdocs/README.txt:{ "additions" [ { "path": "docs/README.txt", "contents": base64encode("hello world\n") } ] } -
Existing file modification: change existing
docs/README.txtto have new contentnew 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.txtwith previous contenthello world\nto the same content atnewdocs/README.txt:{ "deletions" [ { "path": "docs/README.txt", } ], "additions" [ { "path": "newdocs/README.txt", "contents": base64encode("hello world\n") } ] } -
File rename with changes: rename
docs/README.txtwith previous contenthello world\nto a file at pathnewdocs/README.txtwith contentnew contents\n:{ "deletions" [ { "path": "docs/README.txt", } ], "additions" [ { "path": "newdocs/README.txt", "contents": base64encode("new contents\n") } ] }.
Campos de entrada para FileChanges
| Nombre | Descripción |
|---|---|
| File to add or change. |
| Files to delete. |
FileDeletion
A command to delete the file at the given path as part of a commit.
Campos de entrada para FileDeletion
| Nombre | Descripción |
|---|---|
| The path to delete. |
RefOrder
Ways in which lists of git refs can be ordered upon return.
Campos de entrada para RefOrder
| Nombre | Descripción |
|---|---|
| The direction in which to order refs by the specified field. |
| The field in which to order refs by. |
RefUpdate
A ref update.
Campos de entrada para RefUpdate
| Nombre | Descripción |
|---|---|
| The value this ref should be updated to. |
| The value this ref needs to point to before the update. |
| Force a non fast-forward update. |
| The fully qualified name of the ref to be update. For example |
UpdateRefInput
Autogenerated input type of UpdateRef.
Campos de entrada para UpdateRefInput
| Nombre | Descripción |
|---|---|
| A unique identifier for the client performing the mutation. |
| Permit updates of branch Refs that are not fast-forwards?. |
| The GitObjectID that the Ref shall be updated to target. |
| The Node ID of the Ref to be updated. |
UpdateRefsInput
Autogenerated input type of UpdateRefs.
Campos de entrada para UpdateRefsInput
| Nombre | Descripción |
|---|---|
| A unique identifier for the client performing the mutation. |
| A list of ref updates. |
| The Node ID of the repository. |