Skip to main content

This version of GitHub Enterprise Server will be discontinued on 2026-09-22. Discontinued releases are not supported. No patch releases will be made, even for critical security issues. For better performance, improved security, and new features in GitHub Enterprise Server, see Overview of the upgrade process. For help with the upgrade, GitHub Enterprise Support.

Repositories

Reference documentation for GraphQL schema types in the Repositories category.

In this article

Queries

repository

Query

Lookup a given repository by the owner and repository name.

Type: Repository

Arguments for repository

NameDescription

followRenames (Boolean)

Follow repository renames. If disabled, a repository referenced by its old name will return an error.

The default value is true.

name (String!)

The name of the repository.

owner (String!)

The login field of a user or organization.

repositoryOwner

Query

Lookup a repository owner (ie. either a User or an Organization) by login.

Type: RepositoryOwner

Arguments for repositoryOwner

NameDescription

login (String!)

The username to lookup the owner by.

topic

Query

Look up a topic by name.

Type: Topic

Arguments for topic

NameDescription

name (String!)

The topic's name.

Mutations

archiveRepository

Mutation

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.

cloneTemplateRepository

Mutation

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.

createRepository

Mutation

Create a new repository.

Input fields for createRepository

Return fields for createRepository

NameDescription

clientMutationId (String)

A unique identifier for the client performing the mutation.

repository (Repository)

The new repository.

createRepositoryRuleset

Mutation

Create a repository ruleset.

Input fields for createRepositoryRuleset

Return fields for createRepositoryRuleset

NameDescription

clientMutationId (String)

A unique identifier for the client performing the mutation.

ruleset (RepositoryRuleset)

The newly created Ruleset.

deleteRepositoryRuleset

Mutation

Delete a repository ruleset.

Input fields for deleteRepositoryRuleset

Return fields for deleteRepositoryRuleset

NameDescription

clientMutationId (String)

A unique identifier for the client performing the mutation.

unarchiveRepository

Mutation

Unarchives a repository.

Input fields for unarchiveRepository

Return fields for unarchiveRepository

NameDescription

clientMutationId (String)

A unique identifier for the client performing the mutation.

repository (Repository)

The repository that was unarchived.

updateRepository

Mutation

Update information about a repository.

Input fields for updateRepository

Return fields for updateRepository

NameDescription

clientMutationId (String)

A unique identifier for the client performing the mutation.

repository (Repository)

The updated repository.

updateRepositoryRuleset

Mutation

Update a repository ruleset.

Input fields for updateRepositoryRuleset

Return fields for updateRepositoryRuleset

NameDescription

clientMutationId (String)

A unique identifier for the client performing the mutation.

ruleset (RepositoryRuleset)

The newly created Ruleset.

updateRepositoryWebCommitSignoffSetting

Mutation

Sets whether contributors are required to sign off on web-based commits for a repository.

Input fields for updateRepositoryWebCommitSignoffSetting

Return fields for updateRepositoryWebCommitSignoffSetting

NameDescription

clientMutationId (String)

A unique identifier for the client performing the mutation.

message (String)

A message confirming the result of updating the web commit signoff setting.

repository (Repository)

The updated repository.

updateTopics

Mutation

Replaces the repository's topics with the given topics.

Input fields for updateTopics

Return fields for updateTopics

NameDescription

clientMutationId (String)

A unique identifier for the client performing the mutation.

invalidTopicNames ([String!])

Names of the provided topics that are not valid.

repository (Repository)

The updated repository.

Objects

CodeScanningParameters

Object

Choose which tools must provide code scanning results before the reference is updated. When configured, code scanning must be enabled and have results for both the commit and the reference being updated.

Fields for CodeScanningParameters

NameDescription

codeScanningTools ([CodeScanningTool!]!)

Tools that must provide code scanning results for this rule to pass.

CodeScanningTool

Object

A tool that must provide code scanning results for this rule to pass.

Fields for CodeScanningTool

NameDescription

alertsThreshold (String!)

The severity level at which code scanning results that raise alerts block a reference update. For more information on alert severity levels, see "About code scanning alerts.".

securityAlertsThreshold (String!)

The severity level at which code scanning results that raise security alerts block a reference update. For more information on security severity levels, see "About code scanning alerts.".

tool (String!)

The name of a code scanning tool.

ContributingGuidelines

Object

The Contributing Guidelines for a repository.

Fields for ContributingGuidelines

NameDescription

body (String)

The body of the Contributing Guidelines.

resourcePath (URI)

The HTTP path for the Contributing Guidelines.

url (URI)

The HTTP URL for the Contributing Guidelines.

FileExtensionRestrictionParameters

Object

Prevent commits that include files with specified file extensions from being pushed to the commit graph.

Fields for FileExtensionRestrictionParameters

NameDescription

restrictedFileExtensions ([String!]!)

The file extensions that are restricted from being pushed to the commit graph.

FilePathRestrictionParameters

Object

Prevent commits that include changes in specified file paths from being pushed to the commit graph.

Fields for FilePathRestrictionParameters

NameDescription

restrictedFilePaths ([String!]!)

The file paths that are restricted from being pushed to the commit graph.

Language

Object

Represents a given language found in repositories.

Language Implements

Fields for Language

NameDescription

color (String)

The color defined for the current language.

id (ID!)

The Node ID of the Language object.

name (String!)

The name of the current language.

LanguageConnection

Object

A list of languages associated with the parent.

Fields for LanguageConnection

NameDescription

edges ([LanguageEdge])

A list of edges.

nodes ([Language])

A list of nodes.

pageInfo (PageInfo!)

Information to aid in pagination.

totalCount (Int!)

Identifies the total count of items in the connection.

totalSize (Int!)

The total size in bytes of files written in that language.

LanguageEdge

Object

Represents the language of a repository.

Fields for LanguageEdge

NameDescription

cursor (String!)

N/A

node (Language!)

N/A

size (Int!)

The number of bytes of code written in the language.

MaxFilePathLengthParameters

Object

Prevent commits that include file paths that exceed a specified character limit from being pushed to the commit graph.

Fields for MaxFilePathLengthParameters

NameDescription

maxFilePathLength (Int!)

The maximum amount of characters allowed in file paths.

MaxFileSizeParameters

Object

Prevent commits that exceed a specified file size limit from being pushed to the commit graph.

Fields for MaxFileSizeParameters

NameDescription

maxFileSize (Int!)

The maximum file size allowed in megabytes. This limit does not apply to Git Large File Storage (Git LFS).

PermissionSource

Object

A level of permission and source for a user's access to a repository.

Fields for PermissionSource

NameDescription

organization (Organization!)

The organization the repository belongs to.

permission (DefaultRepositoryPermissionField!)

The level of access this source has granted to the user.

roleName (String)

The name of the role this source has granted to the user.

source (PermissionGranter!)

The source of this permission.

PropertyTargetDefinition

Object

A property that must match.

Fields for PropertyTargetDefinition

NameDescription

name (String!)

The name of the property.

propertyValues ([String!]!)

The values to match for.

source (String)

The source of the property. Choosecustomor 'system'. Defaults to 'custom' if not specified.

RepoAccessAuditEntry

Object

Audit log entry for a repo.access event.

RepoAccessAuditEntry Implements

Fields for RepoAccessAuditEntry

NameDescription

action (String!)

The action name.

actor (AuditEntryActor)

The user who initiated the action.

actorIp (String)

The IP address of the actor.

actorLocation (ActorLocation)

A readable representation of the actor's location.

actorLogin (String)

The username of the user who initiated the action.

actorResourcePath (URI)

The HTTP path for the actor.

actorUrl (URI)

The HTTP URL for the actor.

createdAt (PreciseDateTime!)

The time the action was initiated.

id (ID!)

The Node ID of the RepoAccessAuditEntry object.

operationType (OperationType)

The corresponding operation type for the action.

organization (Organization)

The Organization associated with the Audit Entry.

organizationName (String)

The name of the Organization.

organizationResourcePath (URI)

The HTTP path for the organization.

organizationUrl (URI)

The HTTP URL for the organization.

repository (Repository)

The repository associated with the action.

repositoryName (