Skip to main content

此版本的 GitHub Enterprise Server 将于以下日期停止服务 2026-06-02. 即使针对重大安全问题,也不会发布补丁。 为了获得更好的性能、更高的安全性和新功能,请升级到最新版本的 GitHub Enterprise。 如需升级帮助,请联系 GitHub Enterprise 支持

Reference documentation for GraphQL schema types in the Projects (classic) category.

Mutations

addProjectCard

Mutation

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

输入 addProjectCard 字段

返回 addProjectCard 字段

名称说明

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

Mutation

Adds a column to a Project.

输入 addProjectColumn 字段

返回 addProjectColumn 字段

名称说明

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.

cloneProject

Mutation

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

输入 cloneProject 字段

返回 cloneProject 字段

名称说明

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.

convertProjectCardNoteToIssue

Mutation

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

输入 convertProjectCardNoteToIssue 字段

返回 convertProjectCardNoteToIssue 字段

名称说明

clientMutationId (String)

A unique identifier for the client performing the mutation.

projectCard (ProjectCard)

The updated ProjectCard.

createProject

Mutation

Creates a new project.

输入 createProject 字段

返回 createProject 字段

名称说明

clientMutationId (String)

A unique identifier for the client performing the mutation.

project (Project)

The new project.

deleteProject

Mutation

Deletes a project.

输入 deleteProject 字段

返回 deleteProject 字段

名称说明

clientMutationId (String)

A unique identifier for the client performing the mutation.

owner (ProjectOwner)

The repository or organization the project was removed from.

deleteProjectCard

Mutation

Deletes a project card.

输入 deleteProjectCard 字段

返回 deleteProjectCard 字段

名称说明

clientMutationId (String)

A unique identifier for the client performing the mutation.

column (ProjectColumn)

The column the deleted card was in.

deletedCardId (ID)

The deleted card ID.

deleteProjectColumn

Mutation

Deletes a project column.

输入 deleteProjectColumn 字段

返回 deleteProjectColumn 字段

名称说明

clientMutationId (String)

A unique identifier for the client performing the mutation.

deletedColumnId (ID)

The deleted column ID.

project (Project)

The project the deleted column was in.

linkRepositoryToProject

Mutation

Creates a repository link for a project.

输入 linkRepositoryToProject 字段

返回 linkRepositoryToProject 字段

名称说明

clientMutationId (String)

A unique identifier for the client performing the mutation.

project (Project)

The linked Project.

repository (Repository)

The linked Repository.

moveProjectCard

Mutation

Moves a project card to another place.

输入 moveProjectCard 字段

返回 moveProjectCard 字段

名称说明

cardEdge (ProjectCardEdge)

The new edge of the moved card.

clientMutationId (String)

A unique identifier for the client performing the mutation.

moveProjectColumn

Mutation

Moves a project column to another place.

输入 moveProjectColumn 字段

返回 moveProjectColumn 字段

名称说明

clientMutationId (String)

A unique identifier for the client performing the mutation.

columnEdge (ProjectColumnEdge)

The new edge of the moved column.

unlinkRepositoryFromProject

Mutation

Deletes a repository link from a project.

输入 unlinkRepositoryFromProject 字段

返回 unlinkRepositoryFromProject 字段

名称说明

clientMutationId (String)

A unique identifier for the client performing the mutation.

project (Project)

The linked Project.

repository (Repository)

The linked Repository.

updateProject

Mutation

Updates an existing project.

输入 updateProject 字段

返回 updateProject 字段

名称说明

clientMutationId (String)

A unique identifier for the client performing the mutation.

project (Project)

The updated project.

updateProjectCard

Mutation

Updates an existing project card.

输入 updateProjectCard 字段

返回 updateProjectCard 字段

名称说明

clientMutationId (String)

A unique identifier for the client performing the mutation.

projectCard (ProjectCard)

The updated ProjectCard.

updateProjectColumn

Mutation

Updates an existing project column.

输入 updateProjectColumn 字段

返回 updateProjectColumn 字段

名称说明

clientMutationId (String)

A unique identifier for the client performing the mutation.

projectColumn (ProjectColumn)

The updated project column.

Objects

AddedToProjectEvent

Object

Represents aadded_to_projectevent on a given issue or pull request.

AddedToProjectEvent 实现

AddedToProjectEvent 字段

名称说明

actor (Actor)

Identifies the actor who performed the event.

createdAt (DateTime!)

Identifies the date and time when the object was created.

databaseId (Int)

Identifies the primary key from the database.

id (ID!)

The Node ID of the AddedToProjectEvent object.

project (Project)

Project referenced by event.

projectCard (ProjectCard)

Project card referenced by this project event.

projectColumnName (String!)

Column name referenced by this project event.

MovedColumnsInProjectEvent

Object

Represents amoved_columns_in_projectevent on a given issue or pull request.

MovedColumnsInProjectEvent 实现

MovedColumnsInProjectEvent 字段

名称说明

actor (Actor)

Identifies the actor who performed the event.

createdAt (DateTime!)

Identifies the date and time when the object was created.

databaseId (Int)

Identifies the primary key from the database.

id (ID!)

The Node ID of the MovedColumnsInProjectEvent object.

previousProjectColumnName (String!)

Column name the issue or pull request was moved from.

project (Project)

Project referenced by event.

projectCard (ProjectCard)

Project card referenced by this project event.

projectColumnName (String!)

Column name the issue or pull request was moved to.

Project

Object

Projects manage issues, pull requests and notes within a project owner.

Project 实现

Project 字段

名称说明

body (String)

The project's description body.

bodyHTML (HTML!)

The projects description body rendered to HTML.

closed (Boolean!)

Indicates if the object is closed (definition of closed may depend on type).

closedAt (DateTime)

Identifies the date and time when the object was closed.

columns (ProjectColumnConnection!)

List of columns in the project.

columns 的参数

  • after (String)

    Returns the elements in the list that come after the specified cursor.

  • before (String)

    Returns the elements in the list that come before the specified cursor.

  • first (Int)

    Returns the first n elements from the list.

  • last (Int)

    Returns the last n elements from the list.

createdAt (DateTime!)

Identifies the date and time when the object was created.

creator (Actor)

The actor who originally created the project.

databaseId (Int)

Identifies the primary key from the database.

id (ID!)

The Node ID of the Project object.

name (String!)

The project's name.

number (Int!)

The project's number.

owner (ProjectOwner!)

The project's owner. Currently limited to repositories, organizations, and users.

pendingCards (ProjectCardConnection!)

List of pending cards in this project.

pendingCards 的参数

  • after (String)

    Returns the elements in the list that come after the specified cursor.

  • before (String)

    Returns the elements in the list that come before the specified cursor.

  • first (Int)

    Returns the first n elements from the list.

  • last (Int)

    Returns the last n elements from the list.

progress (ProjectProgress!)

Project progress details.

resourcePath (URI!)

The HTTP path for this project.

state (ProjectState!)

Whether the project is open or closed.

updatedAt (DateTime!)

Identifies the date and time when the object was last updated.

url (URI!)

The HTTP URL for this project.

viewerCanClose (Boolean!)

Indicates if the object can be closed by the viewer.

viewerCanReopen (Boolean!)

Indicates if the object can be reopened by the viewer.

viewerCanUpdate (Boolean!)

Check if the current viewer can update this object.

ProjectCard

Object

A card in a project.

ProjectCard 实现

ProjectCard 字段

名称说明

column (ProjectColumn)

The project column this card is associated under. A card may only belong to one project column at a time. The column field will be null if the card is created in a pending state and has yet to be associated with a column. Once cards are associated with a column, they will not become pending in the future.

content (ProjectCardItem)

The card content item.

createdAt (DateTime!)

Identifies the date and time when the object was created.

creator (Actor)

The actor who created this card.

databaseId (Int)

Identifies the primary key from the database.

id (ID!)

The Node ID of the ProjectCard object.

isArchived (Boolean!)

Whether the card is archived.

note (String)

The card note.

project (Project!)

The project that contains this card.

resourcePath (URI!)

The HTTP path for this card.

state (ProjectCardState)

The state of ProjectCard.

updatedAt (DateTime!)

Identifies the date and time when the object was last updated.

url (URI!)

The HTTP URL for this card.

ProjectCardConnection

Object

The connection type for ProjectCard.

ProjectCardConnection 字段

名称说明

edges ([ProjectCardEdge])

A list of edges.

nodes ([ProjectCard])

A list of nodes.

pageInfo (PageInfo!)

Information to aid in pagination.

totalCount (Int!)

Identifies the total count of items in the connection.

ProjectCardEdge

Object

An edge in a connection.

ProjectCardEdge 字段

名称说明

cursor (String!)

A cursor for use in pagination.

node (ProjectCard)

The item at the end of the edge.

ProjectColumn

Object

A column inside a project.

ProjectColumn 实现

ProjectColumn 字段

名称说明

cards (ProjectCardConnection!)

List of cards in the column.

cards 的参数

  • after (String)

    Returns the elements in the list that come after the specified cursor.

  • before (String)

    Returns the elements in the list that come before the specified cursor.

  • first (Int)

    Returns the first n elements from the list.

  • last (Int)

    Returns the last n elements from the list.

createdAt (DateTime!)

Identifies the date and time when the object was created.

databaseId (Int)

Identifies the primary key from the database.

id (ID!)

The Node ID of the ProjectColumn object.

name (String!)

The project column's name.

project (Project!)

The project that contains this column.

purpose (ProjectColumnPurpose)

The semantic purpose of the column.

resourcePath (URI!)

The HTTP path for this project column.

updatedAt (DateTime!)

Identifies the date and time when the object was last updated.

url (URI!)

The HTTP URL for this project column.

ProjectColumnConnection

Object

The connection type for ProjectColumn.

ProjectColumnConnection 字段

名称说明

edges ([ProjectColumnEdge])

A list of edges.

nodes ([ProjectColumn])

A list of nodes.

pageInfo (PageInfo!)

Information to aid in pagination.

totalCount (Int!)

Identifies the total count of items in the connection.

ProjectColumnEdge

Object

An edge in a connection.

ProjectColumnEdge 字段

名称说明

cursor (String!)

A cursor for use in pagination.

node (ProjectColumn)

The item at the end of the edge.

ProjectConnection

Object

A list of projects associated with the owner.

ProjectConnection 字段

名称说明

edges ([ProjectEdge])

A list of edges.

nodes ([Project])

A list of nodes.

pageInfo (PageInfo!)

Information to aid in pagination.

totalCount (Int!)

Identifies the total count of items in the connection.

ProjectEdge

Object

An edge in a connection.

ProjectEdge 字段

名称说明

cursor (String!)

A cursor for use in pagination.

node (Project)

The item at the end of the edge.

ProjectProgress

Object

Project progress stats.

ProjectProgress 字段

名称说明

doneCount (Int!)

The number of done cards.

donePercentage (Float!)

The percentage of done cards.

enabled (Boolean!)

Whether progress tracking is enabled and cards with purpose exist for this project.

inProgressCount (Int!)

The number of in-progress cards.

inProgressPercentage (Float!)

The percentage of in-progress cards.

todoCount (Int!)

The number of to do cards.

todoPercentage (Float!)

The percentage of to do cards.

RemovedFromProjectEvent

Object

Represents aremoved_from_projectevent on a given issue or pull request.

RemovedFromProjectEvent 实现

RemovedFromProjectEvent 字段

名称说明

actor (Actor)

Identifies the actor who performed the event.

createdAt (DateTime!)

Identifies the date and time when the object was created.

databaseId (Int)

Identifies the primary key from the database.

id (ID!)

The Node ID of the RemovedFromProjectEvent object.

project (Project)

Project referenced by event.

projectColumnName (String!)

Column name referenced by this project event.

Interfaces

ProjectOwner

Interface

Represents an owner of a Project.

ProjectOwner 的实现方式

ProjectOwner 字段

名称说明

id (ID!)

The Node ID of the ProjectOwner object.

project (Project)

Find project by number.

project 的参数

  • number (Int!)

    The project number to find.

projects (ProjectConnection!)

A list of projects under the owner.

projects 的参数

  • after (String)

    Returns the elements in the list that come after the specified cursor.

  • before (String)

    Returns the elements in the list that come before the specified cursor.

  • first (Int)

    Returns the first n elements from the list.

  • last (Int)

    Returns the last n elements from the list.

  • orderBy (ProjectOrder)

    Ordering options for projects returned from the connection.

  • search (String)

    Query to search projects by, currently only searching by name.

projectsResourcePath (URI!)

The HTTP path listing owners projects.

projectsUrl (URI!)

The HTTP URL listing owners projects.

viewerCanCreateProjects (Boolean!)

Can the current viewer create new projects on this owner.

Enums

ProjectCardArchivedState

Enum

The possible archived states of a project card.

ProjectCardArchivedState 的值

名称说明
ARCHIVED

A project card that is archived.

NOT_ARCHIVED

A project card that is not archived.

ProjectCardState

Enum

Various content states of a ProjectCard.

ProjectCardState 的值

名称说明
CONTENT_ONLY

The card has content only.

NOTE_ONLY

The card has a note only.

REDACTED

The card is redacted.

ProjectColumnPurpose

Enum

The semantic purpose of the column - todo, in progress, or done.

ProjectColumnPurpose 的值

名称说明
DONE

The column contains cards which are complete.

IN_PROGRESS

The column contains cards which are currently being worked on.

TODO

The column contains cards still to be worked on.

ProjectOrderField

Enum

Properties by which project connections can be ordered.

ProjectOrderField 的值

名称说明
CREATED_AT

Order projects by creation time.

NAME

Order projects by name.

UPDATED_AT

Order projects by update time.

ProjectState

Enum

State of the project; eitheropenor 'closed'.

ProjectState 的值

名称说明
CLOSED

The project is closed.

OPEN

The project is open.

ProjectTemplate

Enum

GitHub-provided templates for Projects.

ProjectTemplate 的值

名称说明
AUTOMATED_KANBAN_V2

Create a board with v2 triggers to automatically move cards across To do, In progress and Done columns.

AUTOMATED_REVIEWS_KANBAN

Create a board with triggers to automatically move cards across columns with review automation.

BASIC_KANBAN

Create a board with columns for To do, In progress and Done.

BUG_TRIAGE

Create a board to triage and prioritize bugs with To do, priority, and Done columns.

Unions

ProjectCardItem

Union

Types that can be inside Project Cards.

ProjectCardItem 可能类型

Input objects

AddProjectCardInput

Input object

Autogenerated input type of AddProjectCard.

输入 AddProjectCardInput 字段

名称说明

clientMutationId (String)

A unique identifier for the client performing the mutation.

contentId (ID)

The content of the card. Must be a member of the ProjectCardItem union.

note (String)

The note on the card.

projectColumnId (ID!)

The Node ID of the ProjectColumn.

AddProjectColumnInput

Input object

Autogenerated input type of AddProjectColumn.

输入 AddProjectColumnInput 字段

名称说明

clientMutationId (String)

A unique identifier for the client performing the mutation.

name (String!)

The name of the column.

projectId (ID!)

The Node ID of the project.

CloneProjectInput

Input object

Autogenerated input type of CloneProject.

输入 CloneProjectInput 字段

名称说明

body (String)

The description of the project.

clientMutationId (String)

A unique identifier for the client performing the mutation.

includeWorkflows (Boolean!)

Whether or not to clone the source project's workflows.

name (String!)

The name of the project.

public (Boolean)

The visibility of the project, defaults to false (private).

sourceId (ID!)

The source project to clone.

targetOwnerId (ID!)

The owner ID to create the project under.

ConvertProjectCardNoteToIssueInput

Input object

Autogenerated input type of ConvertProjectCardNoteToIssue.

输入 ConvertProjectCardNoteToIssueInput 字段

名称说明

body (String)

The body of the newly created issue.

clientMutationId (String)

A unique identifier for the client performing the mutation.

projectCardId (ID!)

The ProjectCard ID to convert.

repositoryId (ID!)

The ID of the repository to create the issue in.

title (String)

The title of the newly created issue. Defaults to the card's note text.

CreateProjectInput

Input object

Autogenerated input type of CreateProject.

输入 CreateProjectInput 字段

名称说明

body (String)

The description of project.

clientMutationId (String)

A unique identifier for the client performing the mutation.

name (String!)

The name of project.

ownerId (ID!)

The owner ID to create the project under.

repositoryIds ([ID!])

A list of repository IDs to create as linked repositories for the project.

template (ProjectTemplate)

The name of the GitHub-provided template.

DeleteProjectCardInput

Input object

Autogenerated input type of DeleteProjectCard.

输入 DeleteProjectCardInput 字段

名称说明

cardId (ID!)

The id of the card to delete.

clientMutationId (String)

A unique identifier for the client performing the mutation.

DeleteProjectColumnInput

Input object

Autogenerated input type of DeleteProjectColumn.

输入 DeleteProjectColumnInput 字段

名称说明

clientMutationId (String)

A unique identifier for the client performing the mutation.

columnId (ID!)

The id of the column to delete.

DeleteProjectInput

Input object

Autogenerated input type of DeleteProject.

输入 DeleteProjectInput 字段

名称说明

clientMutationId (String)

A unique identifier for the client performing the mutation.

projectId (ID!)

The Project ID to update.

LinkRepositoryToProjectInput

Input object

Autogenerated input type of LinkRepositoryToProject.

输入 LinkRepositoryToProjectInput 字段

名称说明

clientMutationId (String)

A unique identifier for the client performing the mutation.

projectId (ID!)

The ID of the Project to link to a Repository.

repositoryId (ID!)

The ID of the Repository to link to a Project.

MoveProjectCardInput

Input object

Autogenerated input type of MoveProjectCard.

输入 MoveProjectCardInput 字段

名称说明

afterCardId (ID)

Place the new card after the card with this id. Pass null to place it at the top.

cardId (ID!)

The id of the card to move.

clientMutationId (String)

A unique identifier for the client performing the mutation.

columnId (ID!)

The id of the column to move it into.

MoveProjectColumnInput

Input object

Autogenerated input type of MoveProjectColumn.

输入 MoveProjectColumnInput 字段

名称说明

afterColumnId (ID)

Place the new column after the column with this id. Pass null to place it at the front.

clientMutationId (String)

A unique identifier for the client performing the mutation.

columnId (ID!)

The id of the column to move.

ProjectCardImport

Input object

An issue or PR and its owning repository to be used in a project card.

输入 ProjectCardImport 字段

名称说明

number (Int!)

The issue or pull request number.

repository (String!)

Repository name with owner (owner/repository).

ProjectColumnImport

Input object

A project column and a list of its issues and PRs.

输入 ProjectColumnImport 字段

名称说明

columnName (String!)

The name of the column.

issues ([ProjectCardImport!])

A list of issues and pull requests in the column.

position (Int!)

The position of the column, starting from 0.

ProjectOrder

Input object

Ways in which lists of projects can be ordered upon return.

输入 ProjectOrder 字段

名称说明

direction (OrderDirection!)

The direction in which to order projects by the specified field.

field (ProjectOrderField!)

The field in which to order projects by.

UnlinkRepositoryFromProjectInput

Input object

Autogenerated input type of UnlinkRepositoryFromProject.

输入 UnlinkRepositoryFromProjectInput 字段

名称说明

clientMutationId (String)

A unique identifier for the client performing the mutation.

projectId (ID!)

The ID of the Project linked to the Repository.

repositoryId (ID!)

The ID of the Repository linked to the Project.

UpdateProjectCardInput

Input object

Autogenerated input type of UpdateProjectCard.

输入 UpdateProjectCardInput 字段

名称说明

clientMutationId (String)

A unique identifier for the client performing the mutation.

isArchived (Boolean)

Whether or not the ProjectCard should be archived.

note (String)

The note of ProjectCard.

projectCardId (ID!)

The ProjectCard ID to update.

UpdateProjectColumnInput

Input object

Autogenerated input type of UpdateProjectColumn.

输入 UpdateProjectColumnInput 字段

名称说明

clientMutationId (String)

A unique identifier for the client performing the mutation.

name (String!)

The name of project column.

projectColumnId (ID!)

The ProjectColumn ID to update.

UpdateProjectInput

Input object

Autogenerated input type of UpdateProject.

输入 UpdateProjectInput 字段

名称说明

body (String)

The description of project.

clientMutationId (String)

A unique identifier for the client performing the mutation.

name (String)

The name of project.

projectId (ID!)

The Project ID to update.

public (Boolean)

Whether the project is public or not.

state (ProjectState)

Whether the project is open or closed.