Skip to content
TypeScript
12.5 KB
Raw Blame
"""
Marks an element of a GraphQL schema as only available via a preview header
"""
directive @preview(
  """
  The identifier of the API preview that toggles this field.
  """
  toggledBy: String!
) on ARGUMENT_DEFINITION | ENUM | ENUM_VALUE | FIELD_DEFINITION | INPUT_FIELD_DEFINITION | INPUT_OBJECT | INTERFACE | OBJECT | SCALAR | UNION

"""
Defines what type of global IDs are accepted for a mutation argument of type ID.
"""
directive @possibleTypes(
  """
  Abstract type of accepted global ID
  """
  abstractType: String

  """
  Accepted types of global IDs.
  """
  concreteTypes: [String!]!
) on INPUT_FIELD_DEFINITION

"""
Assigns a documentation category for docs.github.com, aligned with REST API reference sections.
"""
directive @docsCategory(
  """
  The category slug (e.g. "issues", "pulls", "repos").
  """
  name: String!
) on ENUM | FIELD_DEFINITION | INPUT_OBJECT | INTERFACE | OBJECT | UNION

"""
Represents an object which can take actions on GitHub. Typically a User or Bot.
"""
interface Actor {
  """
  A URL pointing to the actor's public avatar.
  """
  avatarUrl(size: Int): URI!

  """
  The username of the actor.
  """
  login: String!
}

"""
Autogenerated input type of AddComment
"""
input AddCommentInput {
  """
  The contents of the comment.
  """
  body: String!

  """
  A unique identifier for the client performing the mutation.
  """
  clientMutationId: String

  """
  The Node ID of the subject to modify.
  """
  subjectId: ID! @possibleTypes(concreteTypes: ["Issue", "PullRequest"], abstractType: "IssueOrPullRequest")
}

"""
Autogenerated return type of AddComment.
"""
type AddCommentPayload {
  """
  The edge from the subject's comment connection.
  """
  commentEdge: IssueCommentEdge
}

"""
Represents an 'added_to_merge_queue' event on a given pull request.
"""
type AddedToMergeQueueEvent implements Node {
  """
  The Node ID of the AddedToMergeQueueEvent object
  """
  id: ID!
}

"""
Represents a 'added_to_project' event on a given issue or pull request.
"""
type AddedToProjectEvent implements Node {
  """
  The Node ID of the AddedToProjectEvent object
  """
  id: ID!
}

"""
A special type of user which takes actions on behalf of GitHub Apps.
"""
type Bot implements Actor & Node {
  """
  A URL pointing to the GitHub App's public avatar.
  """
  avatarUrl(size: Int): URI!

  """
  The Node ID of the Bot object
  """
  id: ID!

  """
  The username of the actor.
  """
  login: String!
}

"""
Represents a 'closed' event on any `Closable`.
"""
type ClosedEvent implements Node {
  """
  Object which triggered the creation of this event.
  """
  closer: Closer

  """
  Identifies the date and time when the object was created.
  """
  createdAt: DateTime!

  """
  The Node ID of the ClosedEvent object
  """
  id: ID!
}

"""
The object which triggered a `ClosedEvent`.
"""
union Closer = Commit | ProjectV2 | PullRequest

"""
Represents a Git commit.
"""
type Commit implements Node {
  """
  The Node ID of the Commit object
  """
  id: ID!

  """
  The Git object ID
  """
  oid: GitObjectID!

  """
  The datetime when this commit was pushed.
  """
  pushedDate: DateTime @deprecated(reason: "`pushedDate` is no longer supported. Removal on 2023-07-01 UTC.")
}

"""
An ISO-8601 encoded UTC date string.
"""
scalar DateTime

"""
A Git object ID.
"""
scalar GitObjectID

"""
An Issue is a place to discuss ideas, enhancements, tasks, and bugs for a project.
"""
type Issue implements Node {
  """
  Identifies the date and time when the object was created.
  """
  createdAt: DateTime!

  """
  The Node ID of the Issue object
  """
  id: ID!

  """
  Indicates whether or not this issue is currently pinned to the repository issues list
  """
  isPinned: Boolean

  """
  Identifies the issue number.
  """
  number: Int!

  """
  Identifies the state of the issue.
  """
  state: IssueState!

  """
  Identifies the reason for the issue state.
  """
  stateReason: IssueStateReason

  """
  A list of events, comments, commits, etc. associated with the issue.
  """
  timelineItems(first: Int, itemTypes: [IssueTimelineItemsItemType!]): IssueTimelineItemsConnection!

  """
  Identifies the issue title.
  """
  title: String!

  """
  The HTTP URL for this issue
  """
  url: URI!
}

"""
Represents a comment on an Issue.
"""
type IssueComment implements Node {
  """
  The actor who authored the comment.
  """
  author: Actor

  """
  The body as Markdown.
  """
  body: String!

  """
  Identifies the date and time when the object was created.
  """
  createdAt: DateTime!

  """
  The Node ID of the IssueComment object
  """
  id: ID!

  """
  The HTTP URL for this issue comment
  """
  url: URI!
}

"""
An edge in a connection.
"""
type IssueCommentEdge {
  """
  The item at the end of the edge.
  """
  node: IssueComment
}

"""
The connection type for Issue.
"""
type IssueConnection {
  """
  A list of nodes.
  """
  nodes: [Issue]

  """
  Information to aid in pagination.
  """
  pageInfo: PageInfo!

  """
  Identifies the total count of items in the connection.
  """
  totalCount: Int!
}

"""
A filter for matching an issue field value. Exactly one value argument should be provided.
"""
input IssueFieldValueFilter {
  """
  Matches a date issue field value (YYYY-MM-DD).
  """
  dateValue: String

  """
  The ID of the issue field to filter by. Exactly one of `fieldId` or `fieldName` must be provided.
  """
  fieldId: ID

  """
  The name of the issue field to filter by. Exactly one of `fieldId` or `fieldName` must be provided.
  """
  fieldName: String

  """
  Matches issues containing all of the multi-select issue field option IDs.
  """
  multiSelectOptionIds: [ID!]

  """
  Matches issues containing all of the multi-select issue field option names.
  """
  multiSelectOptionValues: [String!]

  """
  Matches a numeric issue field value.
  """
  numberValue: Float

  """
  Matches a single-select issue field option by ID.
  """
  singleSelectOptionId: ID

  """
  Matches a single-select issue field option by name.
  """
  singleSelectOptionValue: String

  """
  Matches a text issue field value.
  """
  textValue: String
}

"""
Ways in which to filter lists of issues.
"""
input IssueFilters @docsCategory(name: "issues") {
  """
  List issues assigned to given name. Pass in `null` for issues with no assigned
  user, and `*` for issues assigned to any user.
  """
  assignee: String

  """
  List issues created by given name.
  """
  createdBy: String

  """
  List issues where each supplied issue field value filter matches.
  """
  issueFieldValues: [IssueFieldValueFilter!]

  """
  List issues where the list of label names exist on the issue.
  """
  labels: [String!]

  """
  List issues where the given name is mentioned in the issue.
  """
  mentioned: String

  """
  List issues by given milestone argument. If an string representation of an
  integer is passed, it should refer to a milestone by its database ID. Pass in
  `null` for issues with no milestone, and `*` for issues that are assigned to any milestone.
  """
  milestone: String

  """
  List issues by given milestone argument. If an string representation of an
  integer is passed, it should refer to a milestone by its number field. Pass in
  `null` for issues with no milestone, and `*` for issues that are assigned to any milestone.
  """
  milestoneNumber: String

  """
  List issues that have been updated at or after the given date.
  """
  since: DateTime

  """
  List issues filtered by the list of states given.
  """
  states: [IssueState!]

  """
  List issues filtered by the type given, only supported by searches on repositories.
  """
  type: String

  """
  List issues subscribed to by viewer.
  """
  viewerSubscribed: Boolean = false
}

"""
Ways in which lists of issues can be ordered upon return.
"""
input IssueOrder @docsCategory(name: "issues") {
  """
  The direction in which to order issues by the specified field.
  """
  direction: OrderDirection!

  """
  The field in which to order issues by.
  """
  field: IssueOrderField!
}

"""
Properties by which issue connections can be ordered.
"""
enum IssueOrderField @docsCategory(name: "issues") {
  """
  Order issues by comment count
  """
  COMMENTS

  """
  Order issues by creation time
  """
  CREATED_AT

  """
  Order issues by update time
  """
  UPDATED_AT
}

"""
The possible states of an issue.
"""
enum IssueState @docsCategory(name: "issues") {
  """
  An issue that has been closed
  """
  CLOSED

  """
  An issue that is still open
  """
  OPEN
}

"""
The possible state reasons of an issue.
"""
enum IssueStateReason @docsCategory(name: "issues") {
  """
  An issue that has been closed as completed
  """
  COMPLETED

  """
  An issue that has been closed as a duplicate.
  """
  DUPLICATE

  """
  An issue that has been closed as not planned
  """
  NOT_PLANNED

  """
  An issue that has been reopened
  """
  REOPENED
}

"""
An item in an issue timeline
"""
union IssueTimelineItems = AddedToProjectEvent | ClosedEvent | IssueComment | LabeledEvent

"""
The connection type for IssueTimelineItems.
"""
type IssueTimelineItemsConnection {
  """
  A list of nodes.
  """
  nodes: [IssueTimelineItems]
}

"""
The possible item types found in a timeline.
"""
enum IssueTimelineItemsItemType {
  """
  Represents a 'closed' event on any `Closable`.
  """
  CLOSED_EVENT

  """
  Represents a comment on an Issue.
  """
  ISSUE_COMMENT

  """
  Represents a 'labeled' event on a given issue or pull request.
  """
  LABELED_EVENT
}

"""
A label for categorizing Issues, Pull Requests, Milestones, or Discussions with a given Repository.
"""
type Label implements Node {
  """
  Identifies the label color.
  """
  color: String!

  """
  The Node ID of the Label object
  """
  id: ID!

  """
  Identifies the label name.
  """
  name: String!
}

"""
Represents a 'labeled' event on a given issue or pull request.
"""
type LabeledEvent implements Node {
  """
  Identifies the date and time when the object was created.
  """
  createdAt: DateTime!

  """
  The Node ID of the LabeledEvent object
  """
  id: ID!

  """
  Identifies the label associated with the 'labeled' event.
  """
  label: Label!
}

"""
The root query for implementing GraphQL mutations.
"""
type Mutation {
  """
  Adds a comment to an Issue or Pull Request.
  """
  addComment(input: AddCommentInput!): AddCommentPayload @docsCategory(name: "issues")
}

"""
An object with an ID.
"""
interface Node {
  """
  ID of the object.
  """
  id: ID!
}

"""
Possible directions in which to order a list of items when provided an `orderBy` argument.
"""
enum OrderDirection @docsCategory(name: "meta") {
  """
  Specifies an ascending order for a given `orderBy` argument.
  """
  ASC

  """
  Specifies a descending order for a given `orderBy` argument.
  """
  DESC
}

"""
Information about pagination in a connection.
"""
type PageInfo {
  """
  When paginating forwards, the cursor to continue.
  """
  endCursor: String

  """
  When paginating forwards, are there more items?
  """
  hasNextPage: Boolean!
}

"""
New projects that manage issues, pull requests and drafts using tables and boards.
"""
type ProjectV2 implements Node {
  """
  The Node ID of the ProjectV2 object
  """
  id: ID!
}

"""
A repository pull request.
"""
type PullRequest implements Node {
  """
  The Node ID of the PullRequest object
  """
  id: ID!

  """
  Identifies the pull request number.
  """
  number: Int!

  """
  Identifies the pull request title.
  """
  title: String!
}

"""
The query root of GitHub's GraphQL interface.
"""
type Query implements Node {
  """
  ID of the object.
  """
  id: ID!

  """
  Fetches an object given its ID.
  """
  node(id: ID!): Node

  """
  Lookup a given repository by the owner and repository name.
  """
  repository(name: String!, owner: String!): Repository
}

"""
A repository contains the content for a project.
"""
type Repository implements Node {
  """
  The Node ID of the Repository object
  """
  id: ID!

  """
  A list of issues that have been opened in the repository.
  """
  issues(filterBy: IssueFilters, first: Int, orderBy: IssueOrder, states: [IssueState!]): IssueConnection!

  """
  The repository's name with owner.
  """
  nameWithOwner: String!
}

"""
An RFC 3986, RFC 3987, and RFC 6570 (level 4) compliant URI string.
"""
scalar URI

"""
A user is an individual's account on GitHub that owns repositories and can make new content.
"""
type User implements Actor & Node {
  """
  A URL pointing to the user's public avatar.
  """
  avatarUrl(size: Int): URI!

  """
  The Node ID of the User object
  """
  id: ID!

  """
  The username used to login.
  """
  login: String!

  """
  The user's public profile name.
  """
  name: String
}