Skip to main content

The mutation type defines GraphQL operations that change data on the server.

In this article

About mutations

Every GraphQL schema has a root type for both queries and mutations. The mutation type defines GraphQL operations that change data on the server. It is analogous to performing HTTP verbs such as POST, PATCH, and DELETE.

For more information, see Forming calls with GraphQL.

abortQueuedMigrations

Clear all of a customer's queued migrations.

Input fields for abortQueuedMigrations

Return fields for abortQueuedMigrations

NameDescription

clientMutationId (String)

A unique identifier for the client performing the mutation.

success (Boolean)

Did the operation succeed?.

abortRepositoryMigration

Abort a repository migration queued or in progress.

Input fields for abortRepositoryMigration

Return fields for abortRepositoryMigration

NameDescription

clientMutationId (String)

A unique identifier for the client performing the mutation.

success (Boolean)

Did the operation succeed?.

acceptEnterpriseAdministratorInvitation

Accepts a pending invitation for a user to become an administrator of an enterprise.

Input fields for acceptEnterpriseAdministratorInvitation

Return fields for acceptEnterpriseAdministratorInvitation

NameDescription

clientMutationId (String)

A unique identifier for the client performing the mutation.

invitation (EnterpriseAdministratorInvitation)

The invitation that was accepted.

message (String)

A message confirming the result of accepting an administrator invitation.

acceptEnterpriseMemberInvitation

Accepts a pending invitation for a user to become an unaffiliated member of an enterprise.

Input fields for acceptEnterpriseMemberInvitation

Return fields for acceptEnterpriseMemberInvitation

NameDescription

clientMutationId (String)

A unique identifier for the client performing the mutation.

invitation (EnterpriseMemberInvitation)

The invitation that was accepted.

message (String)

A message confirming the result of accepting an unaffiliated member invitation.

acceptTopicSuggestion

Applies a suggested topic to the repository.

Input fields for acceptTopicSuggestion

Return fields for acceptTopicSuggestion

NameDescription

clientMutationId (String)

A unique identifier for the client performing the mutation.

topic (Topic)

The accepted topic.

Warning

topic is deprecated.

Suggested topics are no longer supported Removal on 2024-04-01 UTC.

accessUserNamespaceRepository

Access user namespace repository for a temporary duration.

Input fields for accessUserNamespaceRepository

Return fields for accessUserNamespaceRepository

NameDescription

clientMutationId (String)

A unique identifier for the client performing the mutation.

expiresAt (DateTime)

The time that repository access expires at.

repository (Repository)

The repository that is temporarily accessible.

addAssigneesToAssignable

Adds assignees to an assignable object.

Input fields for addAssigneesToAssignable

Return fields for addAssigneesToAssignable

NameDescription

assignable (Assignable)

The item that was assigned.

clientMutationId (String)

A unique identifier for the client performing the mutation.

addBlockedBy

Adds a 'blocked by' relationship to an issue.

Input fields for addBlockedBy

Return fields for addBlockedBy

NameDescription

blockingIssue (Issue)

The issue that is blocking the given issue.

clientMutationId (String)

A unique identifier for the client performing the mutation.

issue (Issue)

The issue that is blocked.

addComment

Adds a comment to an Issue or Pull Request.

Input fields for addComment

Return fields for addComment

NameDescription

clientMutationId (String)

A unique identifier for the client performing the mutation.

commentEdge (IssueCommentEdge)

The edge from the subject's comment connection.

subject (Node)

The subject.

timelineEdge (IssueTimelineItemEdge)

The edge from the subject's timeline connection.

addDiscussionComment

Adds a comment to a Discussion, possibly as a reply to another comment.

Input fields for addDiscussionComment

Return fields for addDiscussionComment

NameDescription

clientMutationId (String)

A unique identifier for the client performing the mutation.

comment (DiscussionComment)

The newly created discussion comment.

addDiscussionPollVote

Vote for an option in a discussion poll.

Input fields for addDiscussionPollVote

Return fields for addDiscussionPollVote

NameDescription

clientMutationId (String)

A unique identifier for the client performing the mutation.

pollOption (DiscussionPollOption)

The poll option that a vote was added to.

addEnterpriseOrganizationMember

Adds enterprise members to an organization within the enterprise.

Input fields for addEnterpriseOrganizationMember

Return fields for addEnterpriseOrganizationMember

NameDescription

clientMutationId (String)

A unique identifier for the client performing the mutation.

users ([User!])

The users who were added to the organization.

addEnterpriseSupportEntitlement

Adds a support entitlement to an enterprise member.

Input fields for addEnterpriseSupportEntitlement

Return fields for addEnterpriseSupportEntitlement

NameDescription

clientMutationId (String)

A unique identifier for the client performing the mutation.

message (String)

A message confirming the result of adding the support entitlement.

addLabelsToLabelable

Adds labels to a labelable object.

Input fields for addLabelsToLabelable

Return fields for addLabelsToLabelable

NameDescription

clientMutationId (String)

A unique identifier for the client performing the mutation.

labelable (Labelable)

The item that was labeled.

addProjectCard

Adds a card to a ProjectColumn. Either contentId or note must be provided but not both.

Warning

addProjectCard is deprecated.

Projects (classic) is being deprecated in favor of the new Projects experience, see: https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/. Removal on 2025-04-01 UTC.

Input fields for addProjectCard

Return fields for addProjectCard

NameDescription

cardEdge (ProjectCardEdge)

The edge from the ProjectColumn's card connection.

clientMutationId (String)

A unique identifier for the client performing the mutation.

projectColumn (ProjectColumn)

The ProjectColumn.

addProjectColumn

Adds a column to a Project.

Warning

addProjectColumn is deprecated.

Projects (classic) is being deprecated in favor of the new Projects experience, see: https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/. Removal on 2025-04-01 UTC.

Input fields for addProjectColumn

Return fields for addProjectColumn

NameDescription

clientMutationId (String)

A unique identifier for the client performing the mutation.

columnEdge (ProjectColumnEdge)

The edge from the project's column connection.

project (Project)

The project.

addProjectV2DraftIssue

Creates a new draft issue and add it to a Project.

Input fields for addProjectV2DraftIssue

Return fields for addProjectV2DraftIssue

NameDescription

clientMutationId (String)

A unique identifier for the client performing the mutation.

projectItem (ProjectV2Item)

The draft issue added to the project.

addProjectV2ItemById

Links an existing content instance to a Project.

Input fields for addProjectV2ItemById

Return fields for addProjectV2ItemById

NameDescription

clientMutationId (String)

A unique identifier for the client performing the mutation.

item (ProjectV2Item)

The item added to the project.

addPullRequestReview

Adds a review to a Pull Request.

Input fields for addPullRequestReview

Return fields for addPullRequestReview

NameDescription

clientMutationId (String)

A unique identifier for the client performing the mutation.

pullRequestReview (PullRequestReview)

The newly created pull request review.

reviewEdge (PullRequestReviewEdge)

The edge from the pull request's review connection.

addPullRequestReviewComment

Adds a comment to a review.

Input fields for addPullRequestReviewComment

Return fields for addPullRequestReviewComment

NameDescription

clientMutationId (String)

A unique identifier for the client performing the mutation.

comment (PullRequestReviewComment)

The newly created comment.

commentEdge (PullRequestReviewCommentEdge)

The edge from the review's comment connection.

addPullRequestReviewThread

Adds a new thread to a pending Pull Request Review.

Input fields for addPullRequestReviewThread

Return fields for addPullRequestReviewThread

NameDescription

clientMutationId (String)

A unique identifier for the client performing the mutation.

thread (PullRequestReviewThread)

The newly created thread.

addPullRequestReviewThreadReply

Adds a reply to an existing Pull Request Review Thread.

Input fields for addPullRequestReviewThreadReply

Return fields for addPullRequestReviewThreadReply

NameDescription

clientMutationId (String)

A unique identifier for the client performing the mutation.

comment (PullRequestReviewComment)

The newly created reply.

addReaction

Adds a reaction to a subject.

Input fields for addReaction

Return fields for addReaction

NameDescription

clientMutationId (String)

A unique identifier for the client performing the mutation.

reaction (Reaction)

The reaction object.

reactionGroups ([ReactionGroup!])

The reaction groups for the subject.

subject (Reactable)

The reactable subject.

addStar

Adds a star to a Starrable.

Input fields for addStar

Return fields for addStar

NameDescription

clientMutationId (String)

A unique identifier for the client performing the mutation.

starrable (Starrable)

The starrable.

addSubIssue

Adds a sub-issue to a given issue.

Input fields for addSubIssue

Return fields for addSubIssue

NameDescription

clientMutationId (String)

A unique identifier for the client performing the mutation.

issue (Issue)

The parent issue that the sub-issue was added to.

subIssue (Issue)

The sub-issue of the parent.

addUpvote

Add an upvote to a discussion or discussion comment.

Input fields for addUpvote

Return fields for addUpvote

NameDescription

clientMutationId (String)

A unique identifier for the client performing the mutation.

subject (Votable)

The votable subject.

addVerifiableDomain

Adds a verifiable domain to an owning account.

Input fields for addVerifiableDomain

Return fields for addVerifiableDomain

NameDescription

clientMutationId (String)

A unique identifier for the client performing the mutation.

domain (VerifiableDomain)

The verifiable domain that was added.

approveDeployments

Approve all pending deployments under one or more environments.

Input fields for approveDeployments

Return fields for approveDeployments

NameDescription

clientMutationId (String)

A unique identifier for the client performing the mutation.

deployments ([Deployment!])

The affected deployments.

approveVerifiableDomain

Approve a verifiable domain for notification delivery.

Input fields for approveVerifiableDomain

Return fields for approveVerifiableDomain

NameDescription

clientMutationId (String)

A unique identifier for the client performing the mutation.

domain (VerifiableDomain)

The verifiable domain that was approved.

archiveProjectV2Item

Archives a ProjectV2Item.

Input fields for archiveProjectV2Item

Return fields for archiveProjectV2Item

NameDescription

clientMutationId (String)

A unique identifier for the client performing the mutation.

item (ProjectV2Item)

The item archived from the project.

archiveRepository

Marks a repository as archived.

Input fields for archiveRepository

Return fields for archiveRepository

NameDescription

clientMutationId (String)

A unique identifier for the client performing the mutation.

repository (Repository)

The repository that was marked as archived.

cancelEnterpriseAdminInvitation

Cancels a pending invitation for an administrator to join an enterprise.

Input fields for cancelEnterpriseAdminInvitation

Return fields for cancelEnterpriseAdminInvitation

NameDescription

clientMutationId (String)

A unique identifier for the client performing the mutation.

invitation (EnterpriseAdministratorInvitation)

The invitation that was canceled.

message (String)

A message confirming the result of canceling an administrator invitation.

cancelEnterpriseMemberInvitation

Cancels a pending invitation for an unaffiliated member to join an enterprise.

Input fields for cancelEnterpriseMemberInvitation

Return fields for cancelEnterpriseMemberInvitation

NameDescription

clientMutationId (String)

A unique identifier for the client performing the mutation.

invitation (EnterpriseMemberInvitation)

The invitation that was canceled.

message (String)

A message confirming the result of canceling an member invitation.

cancelSponsorship

Cancel an active sponsorship.

Input fields for cancelSponsorship

Return fields for cancelSponsorship

NameDescription

clientMutationId (String)

A unique identifier for the client performing the mutation.

sponsorsTier (SponsorsTier)

The tier that was being used at the time of cancellation.

changeUserStatus

Update your status on GitHub.

Input fields for changeUserStatus

Return fields for changeUserStatus

NameDescription

clientMutationId (String)

A unique identifier for the client performing the mutation.

status (UserStatus)

Your updated status.

clearLabelsFromLabelable

Clears all labels from a labelable object.

Input fields for clearLabelsFromLabelable

Return fields for clearLabelsFromLabelable

NameDescription

clientMutationId (String)

A unique identifier for the client performing the mutation.

labelable (Labelable)

The item that was unlabeled.

clearProjectV2ItemFieldValue

This mutation clears the value of a field for an item in a Project. Currently only text, number, date, assignees, labels, single-select, iteration and milestone fields are supported.

Input fields for clearProjectV2ItemFieldValue

Return fields for clearProjectV2ItemFieldValue

NameDescription

clientMutationId (String)

A unique identifier for the client performing the mutation.

projectV2Item (ProjectV2Item)

The updated item.

cloneProject

Creates a new project by cloning configuration from an existing project.

Warning

cloneProject is deprecated.

Projects (classic) is being deprecated in favor of the new Projects experience, see: https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/. Removal on 2025-04-01 UTC.

Input fields for cloneProject

Return fields for cloneProject

NameDescription

clientMutationId (String)

A unique identifier for the client performing the mutation.

jobStatusId (String)

The id of the JobStatus for populating cloned fields.

project (Project)

The new cloned project.

cloneTemplateRepository

Create a new repository with the same files and directory structure as a template repository.

Input fields for cloneTemplateRepository

Return fields for cloneTemplateRepository

NameDescription

clientMutationId (String)

A unique identifier for the client performing the mutation.

repository (Repository)

The new repository.

closeDiscussion

Close a discussion.

Input fields for closeDiscussion

Return fields for closeDiscussion

NameDescription

clientMutationId (String)

A unique identifier for the client performing the mutation.

discussion (Discussion)

The discussion that was closed.

closeIssue

Close an issue.

Input fields for closeIssue

Return fields for closeIssue

NameDescription

clientMutationId (String)

A unique identifier for the client performing the mutation.

issue (Issue)

The issue that was closed.

closePullRequest

Close a pull request.

Input fields for closePullRequest

Return fields for closePullRequest

NameDescription

clientMutationId (String)

A unique identifier for the client performing the mutation.

pullRequest (PullRequest)

The pull request that was closed.

convertProjectCardNoteToIssue

Convert a project note card to one associated with a newly created issue.

Warning

convertProjectCardNoteToIssue is deprecated.

Projects (classic) is being deprecated in favor of the new Projects experience, see: https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/. Removal on 2025-04-01 UTC.

Input fields for convertProjectCardNoteToIssue

Return fields for convertProjectCardNoteToIssue

NameDescription

clientMutationId (String)

A unique identifier for the client performing the mutation.

projectCard (ProjectCard)

The updated ProjectCard.

convertProjectV2DraftIssueItemToIssue

Converts a projectV2 draft issue item to an issue.

Input fields for convertProjectV2DraftIssueItemToIssue

Return fields for convertProjectV2DraftIssueItemToIssue

NameDescription

clientMutationId (String)

A unique identifier for the client performing the mutation.

item (ProjectV2Item)

The updated project item.

convertPullRequestToDraft

Converts a pull request to draft.

Input fields for convertPullRequestToDraft

Return fields for convertPullRequestToDraft

NameDescription

clientMutationId (String)

A unique identifier for the client performing the mutation.

pullRequest (PullRequest)

The pull request that is now a draft.

copyProjectV2

Copy a project.

Input fields for copyProjectV2

Return fields for copyProjectV2

NameDescription

clientMutationId (String)

A unique identifier for the client performing the mutation.

projectV2 (ProjectV2)

The copied project.

createAttributionInvitation

Invites a user to claim reattributable data.

Input fields for createAttributionInvitation

Return fields for createAttributionInvitation

NameDescription

clientMutationId (String)

A unique identifier for the client performing the mutation.

owner (Organization)

The owner scoping the reattributable data.

source (Claimable)

The account owning the data to reattribute.

target (Claimable)

The account which may claim the data.

createBranchProtectionRule

Create a new branch protection rule.

Input fields for createBranchProtectionRule

Return fields for createBranchProtectionRule

NameDescription

branchProtectionRule (BranchProtectionRule)

The newly created BranchProtectionRule.

clientMutationId (String)

A unique identifier for the client performing the mutation.

createCheckRun

Create a check run.

Input fields for createCheckRun

Return fields for createCheckRun

NameDescription

checkRun (CheckRun)

The newly created check run.

clientMutationId (String)

A unique identifier for the client performing the mutation.

createCheckSuite

Create a check suite.

Input fields for createCheckSuite

Return fields for createCheckSuite

NameDescription

checkSuite (CheckSuite)

The newly created check suite.

clientMutationId (String)

A unique identifier for the client performing the mutation.

createCommitOnBranch

Appends a commit to the given branch as the authenticated user.

This mutation creates a commit whose parent is the HEAD of the provided branch and also updates that branch to point to the new commit. It can be thought of as similar to git commit.

Locating a Branch

Commits are appended to a branch of type Ref. This must refer to a git branch (i.e. the fully qualified path must begin with refs/heads/, although including this prefix is optional.

Callers may specify the branch to commit to either by its global node ID or by passing both of repositoryNameWithOwner and refName. For more details see the documentation for CommittableBranch.

Describing Changes

fileChanges are specified as a FilesChanges object describing FileAdditions and FileDeletions.

Please see the documentation for FileChanges for more information on how to use this argument to describe any set of file changes.

Authorship

Similar to the web commit interface, this mutation does not support specifying the author or committer of the commit and will not add support for this in the future.

A commit created by a successful execution of this mutation will be authored by the owner of the credential which authenticates the API request. The committer will be identical to that of commits authored using the web interface.

If you need full control over author and committer information, please use the Git Database REST API instead.

Commit Signing

Commits made using this mutation are automatically signed by GitHub if supported and will be marked as verified in the user interface.

Input fields for createCommitOnBranch

Return fields for createCommitOnBranch

NameDescription

clientMutationId (String)

A unique identifier for the client performing the mutation.

commit (Commit)

The new commit.

ref (Ref)

The ref which has been updated to point to the new commit.

createDeployment

Creates a new deployment event.

Input fields for createDeployment

Return fields for createDeployment

NameDescription

autoMerged (Boolean)

True if the default branch has been auto-merged into the deployment ref.

clientMutationId (String)

A unique identifier for the client performing the mutation.

deployment (Deployment)

The new deployment.

createDeploymentStatus

Create a deployment status.

Input fields for createDeploymentStatus

Return fields for createDeploymentStatus

NameDescription

clientMutationId (String)

A unique identifier for the client performing the mutation.

deploymentStatus (DeploymentStatus)

The new deployment status.

createDiscussion

Create a discussion.

Input fields for createDiscussion

Return fields for createDiscussion

NameDescription

clientMutationId (String)

A unique identifier for the client performing the mutation.

discussion (Discussion)

The discussion that was just created.

createEnterpriseOrganization

Creates an organization as part of an enterprise account. A personal access token used to create an organization is implicitly permitted to update the organization it created, if the organization is part of an enterprise that has SAML enabled or uses Enterprise Managed Users. If the organization is not part of such an enterprise, and instead has SAML enabled for it individually, the token will then require SAML authorization to continue working against that organization.

Input fields for createEnterpriseOrganization

Return fields for createEnterpriseOrganization

NameDescription

clientMutationId (String)

A unique identifier for the client performing the mutation.

enterprise (Enterprise)

The enterprise that owns the created organization.

organization (Organization)

The organization that was created.

createEnvironment

Creates an environment or simply returns it if already exists.

Input fields for createEnvironment

Return fields for createEnvironment

NameDescription

clientMutationId (String)

A unique identifier for the client performing the mutation.

environment (Environment)

The new or existing environment.

createIpAllowListEntry

Creates a new IP allow list entry.

Input fields for createIpAllowListEntry

Return fields for createIpAllowListEntry

NameDescription

clientMutationId (String)

A unique identifier for the client performing the mutation.

ipAllowListEntry (IpAllowListEntry)

The IP allow list entry that was created.

createIssue

Creates a new issue.

Input fields for createIssue

Return fields for createIssue

NameDescription

clientMutationId (String)

A unique identifier for the client performing the mutation.

issue (Issue)

The new issue.

createIssueType

Creates a new issue type.

Input fields for createIssueType

Return fields for createIssueType

NameDescription

clientMutationId (String)

A unique identifier for the client performing the mutation.

issueType (IssueType)

The newly created issue type.

createLabel

Creates a new label.

Input fields for createLabel

Return fields for createLabel

NameDescription

clientMutationId (String)

A unique identifier for the client performing the mutation.

label (Label)

The new label.

createLinkedBranch

Create a branch linked to an issue.

Input fields for createLinkedBranch

Return fields for createLinkedBranch

NameDescription

clientMutationId (String)

A unique identifier for the client performing the mutation.

issue (Issue)

The issue that was linked to.

linkedBranch (LinkedBranch)

The new branch issue reference.

createMigrationSource

Creates a GitHub Enterprise Importer (GEI) migration source.

Input fields for createMigrationSource

Return fields for createMigrationSource

NameDescription

clientMutationId (String)

A unique identifier for the client performing the mutation.

migrationSource (MigrationSource)

The created migration source.

createProject

Creates a new project.

Warning

createProject is deprecated.

Projects (classic) is being deprecated in favor of the new Projects experience, see: https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/. Removal on 2025-04-01 UTC.

Input fields for createProject

Return fields for createProject

NameDescription

clientMutationId (String)

A unique identifier for the client performing the mutation.

project (Project)

The new project.

createProjectV2

Creates a new project.

Input fields for createProjectV2

Return fields for createProjectV2

NameDescription

clientMutationId (String)

A unique identifier for the client performing the mutation.

projectV2 (ProjectV2)

The new project.

createProjectV2Field

Create a new project field.

Input fields for createProjectV2Field

  • input (