{
  "slug": "github-graphql-api-adds-the-archivepullrequest-mutation-c8ef7fd383a1",
  "title": "GitHub GraphQL API adds the archivePullRequest mutation",
  "tools": [
    "github-graphql-api"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-04-15T00:00:00.000Z",
  "announced_at": "2026-04-15T00:00:00.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "When the pull request should be archived, call `Mutation.archivePullRequest` with its node ID. The mutation closes, locks, and archives the pull request; the GraphQL reference says only repository admins can archive it.",
    "examples": [
      "curl -H \"Authorization: bearer <TOKEN>\" -X POST -d '{\"query\":\"mutation($input: ArchivePullRequestInput!) { archivePullRequest(input: $input) { pullRequest { id } clientMutationId } }\",\"variables\":{\"input\":{\"pullRequestId\":\"<PULL_REQUEST_NODE_ID>\"}}}' https://api.github.com/graphql"
    ],
    "gotchas": [
      "input (required): `ArchivePullRequestInput!` argument for `archivePullRequest`.",
      "pullRequestId (required): Node ID of the pull request to archive (`ID!`).",
      "clientMutationId: Optional unique identifier for the client (`String`). The payload can return it.",
      "pullRequest: Payload field containing the archived pull request (`PullRequest`).",
      "Prerequisite: Authenticate to the GraphQL API using a personal access token, GitHub App, or OAuth app; required token scopes or permissions depend on the requested data/action. GitHub.com endpoint: `https://api.github.com/graphql`.",
      "Prerequisite: The GraphQL reference says only repository admins can archive pull requests.",
      "Docs conflict: GitHub's GraphQL reference says only repository admins can archive pull requests, while its archive guide says anyone with triage, write, maintain, or admin role can archive them: https://docs.github.com/en/enterprise-cloud%40latest/graphql/reference/pulls ; https://docs.github.com/en/communities/moderating-comments-and-conversations/archive-pull-requests"
    ]
  },
  "why_it_matters": "Archive a pull request through the GitHub GraphQL API.",
  "sources": [
    "https://docs.github.com/en/graphql/overview/changelog#schema-changes-for-2026-04-15",
    "https://docs.github.com/en/enterprise-cloud%40latest/graphql/guides/forming-calls-with-graphql",
    "https://docs.github.com/en/enterprise-cloud%40latest/graphql/reference/pulls"
  ],
  "rank": 0.95017,
  "judge": {
    "publish": true,
    "judge_model": "codex-cli/gpt-6-luna+typesafe/jev-1.13.0",
    "prompt_version": "extract-v7+enrich-v2+judge-v2x3+jev-publish-v1"
  },
  "review_state": "approved",
  "provenance": {
    "run_id": "wave1b-tools-20261017",
    "verdict_id": "wave1b-tools-20261017:wave1b-tools-20261017-78d95328de4e94e7-0:gate",
    "evidence_hash": "198634b5fc18e658befa1cc58bad91aa7156c08dd19ffe3ad5c8227cfb911665"
  },
  "review": {
    "draft_hash": "480f1eba342a4198da5bd6c329293575e46e863055a136aa727f4fc094859223",
    "reviewer": "publication-gate",
    "reviewed_at": "2026-10-07T00:00:00.000Z",
    "decision": "wave1b-tools-20261017:gate",
    "reason": "3 of 3 judge runs approved with p_yes >= 0.9 (mean 0.95 >= 0.9; 2 needed) and Jev gave 0.78 (>= 0.6 needed)."
  }
}
