# Authoritative GitHub.com GraphQL read/write contract subset.
# The full schema is intentionally reduced to the types and fields selected by this plugin;
# tests validate every production document against this artifact.
#
# `ProjectV2.shortDescription` and `ProjectV2.readme` are absent on purpose, and so is
# `updateProjectV2`: a board is a container of projects here, never a project, and nothing
# this source does writes the board's own fields. `updateProjectV2Field` is absent for a
# different reason — its `singleSelectOptions` overwrites a field's option set, so no
# addition is additive and a mistake destroys every item's status.
schema {
query: Query
mutation: Mutation
}
scalar String
scalar ID
scalar Int
scalar Boolean
type Query {
repositoryOwner(login: String!): RepositoryOwner
repository(owner: String!, name: String!, followRenames: Boolean = true): Repository
node(id: ID!): Node
}
type Mutation {
createIssue(input: CreateIssueInput!): CreateIssuePayload
addProjectV2ItemById(input: AddProjectV2ItemByIdInput!): AddProjectV2ItemByIdPayload
updateIssue(input: UpdateIssueInput!): UpdateIssuePayload
updateProjectV2DraftIssue(
input: UpdateProjectV2DraftIssueInput!
): UpdateProjectV2DraftIssuePayload
updateProjectV2ItemFieldValue(
input: UpdateProjectV2ItemFieldValueInput!
): UpdateProjectV2ItemFieldValuePayload
addSubIssue(input: AddSubIssueInput!): AddSubIssuePayload
removeSubIssue(input: RemoveSubIssueInput!): RemoveSubIssuePayload
addBlockedBy(input: AddBlockedByInput!): AddBlockedByPayload
removeBlockedBy(input: RemoveBlockedByInput!): RemoveBlockedByPayload
}
input CreateIssueInput {
repositoryId: ID!
title: String!
body: String
labelIds: [ID!]
parentIssueId: ID
}
input AddProjectV2ItemByIdInput {
projectId: ID!
contentId: ID!
}
input UpdateIssueInput {
id: ID!
title: String
body: String
state: IssueState
stateInput: IssueStateUpdateInput
}
input IssueStateUpdateInput {
value: IssueState!
stateReason: IssueClosedStateReason
duplicateIssueId: ID
}
input UpdateProjectV2DraftIssueInput {
draftIssueId: ID!
title: String
body: String
}
input UpdateProjectV2ItemFieldValueInput {
projectId: ID!
itemId: ID!
fieldId: ID!
value: ProjectV2FieldValue!
}
input ProjectV2FieldValue {
text: String
singleSelectOptionId: String
}
input AddSubIssueInput {
issueId: ID!
subIssueId: ID
replaceParent: Boolean
}
input RemoveSubIssueInput {
issueId: ID!
subIssueId: ID!
}
input AddBlockedByInput {
issueId: ID!
blockingIssueId: ID!
}
input RemoveBlockedByInput {
issueId: ID!
blockingIssueId: ID!
}
type CreateIssuePayload {
issue: Issue
}
type AddProjectV2ItemByIdPayload {
item: ProjectV2Item
}
type UpdateIssuePayload {
issue: Issue
}
type UpdateProjectV2DraftIssuePayload {
draftIssue: DraftIssue
}
type UpdateProjectV2ItemFieldValuePayload {
projectV2Item: ProjectV2Item
}
type AddSubIssuePayload {
issue: Issue
subIssue: Issue
}
type RemoveSubIssuePayload {
issue: Issue
subIssue: Issue
}
type AddBlockedByPayload {
issue: Issue
blockingIssue: Issue
}
type RemoveBlockedByPayload {
issue: Issue
blockingIssue: Issue
}
interface Node {
id: ID!
}
interface RepositoryOwner {
id: ID!
}
interface ProjectV2Owner {
projectV2(number: Int!): ProjectV2
}
type Organization implements Node & RepositoryOwner & ProjectV2Owner {
id: ID!
projectV2(number: Int!): ProjectV2
}
type User implements Node & RepositoryOwner & ProjectV2Owner {
id: ID!
projectV2(number: Int!): ProjectV2
}
type ProjectV2 implements Node {
id: ID!
title: String!
createdAt: DateTime!
updatedAt: DateTime!
fields(first: Int, after: String): ProjectV2FieldConfigurationConnection!
items(first: Int, after: String): ProjectV2ItemConnection!
}
type ProjectV2FieldConfigurationConnection {
nodes: [ProjectV2FieldConfiguration]
pageInfo: PageInfo!
}
type ProjectV2Item implements Node {
id: ID!
project: ProjectV2!
fieldValues(first: Int, after: String): ProjectV2ItemFieldValueConnection!
content: ProjectV2ItemContent
}
union ProjectV2ItemContent = DraftIssue | Issue | PullRequest | RedactedProjectV2Item
union ProjectV2ItemFieldValue =
| ProjectV2ItemFieldLabelValue
| ProjectV2ItemFieldSingleSelectValue
| ProjectV2ItemFieldTextValue
union ProjectV2FieldConfiguration = ProjectV2SingleSelectField | ProjectV2Field
type ProjectV2ItemFieldValueConnection {
nodes: [ProjectV2ItemFieldValue]
pageInfo: PageInfo!
}
type ProjectV2ItemFieldSingleSelectValue {
name: String
field: ProjectV2FieldConfiguration!
}
type ProjectV2ItemFieldLabelValue {
labels(first: Int, after: String): LabelConnection!
}
type ProjectV2ItemFieldTextValue {
text: String
field: ProjectV2FieldConfiguration!
}
type ProjectV2SingleSelectField {
id: ID!
name: String!
options: [ProjectV2SingleSelectFieldOption!]!
}
type ProjectV2Field {
id: ID!
name: String!
}
type ProjectV2SingleSelectFieldOption {
id: ID!
name: String!
}
type Issue implements Node {
id: ID!
title: String!
body: String!
url: URI!
createdAt: DateTime!
updatedAt: DateTime!
state: IssueState!
stateReason(enableDuplicate: Boolean = false): IssueStateReason
repository: Repository!
parent: Issue
subIssues(first: Int, after: String): IssueConnection!
subIssuesSummary: SubIssuesSummary!
labels(first: Int, after: String): LabelConnection
blockedBy(first: Int, after: String): IssueConnection!
blocking(first: Int, after: String): IssueConnection!
}
type SubIssuesSummary {
total: Int!
completed: Int!
percentCompleted: Int!
}
type PullRequest implements Node {
id: ID!
title: String!
body: String!
url: URI!
createdAt: DateTime!
updatedAt: DateTime!
state: PullRequestState!
repository: Repository!
labels(first: Int, after: String): LabelConnection
}
type Repository implements Node {
id: ID!
nameWithOwner: String!
}
type DraftIssue implements Node {
id: ID!
title: String!
body: String
createdAt: DateTime!
updatedAt: DateTime!
}
type RedactedProjectV2Item implements Node {
id: ID!
}
type Label implements Node {
id: ID!
name: String!
color: String!
}
type ProjectV2ItemConnection {
nodes: [ProjectV2Item!]
pageInfo: PageInfo!
}
type IssueConnection {
nodes: [Issue]
pageInfo: PageInfo!
}
type LabelConnection {
nodes: [Label]
pageInfo: PageInfo!
}
type PageInfo {
hasNextPage: Boolean!
endCursor: String
}
enum IssueState {
OPEN
CLOSED
}
enum IssueStateReason {
COMPLETED
DUPLICATE
NOT_PLANNED
REOPENED
}
enum IssueClosedStateReason {
COMPLETED
DUPLICATE
NOT_PLANNED
}
enum PullRequestState {
OPEN
CLOSED
MERGED
}
scalar DateTime
scalar URI