The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 04:45 UTC
| 1 | # One pull request per operation. `GraphQLResolver.aliased` repeats each under an alias per |
| 2 | # pull request, so a batch is one request and a missing pull request fails only its own slice. |
| 3 | # `stacks` is false off github.com: Enterprise Server has no pull request stacks. |
| 4 | |
| 5 | query PullRequestSummary($owner: String!, $name: String!, $number: Int!, $stacks: Boolean!) { |
| 6 | repository(owner: $owner, name: $name) { |
| 7 | pullRequest(number: $number) { |
| 8 | number |
| 9 | title |
| 10 | url |
| 11 | state |
| 12 | isDraft |
| 13 | mergeable |
| 14 | reviewDecision |
| 15 | additions |
| 16 | deletions |
| 17 | changedFiles |
| 18 | updatedAt |
| 19 | mergedAt |
| 20 | closedAt |
| 21 | headRefName |
| 22 | baseRefName |
| 23 | author { |
| 24 | login |
| 25 | avatarUrl |
| 26 | ... on User { |
| 27 | name |
| 28 | } |
| 29 | } |
| 30 | latestReviews(first: 20) { |
| 31 | nodes { |
| 32 | state |
| 33 | isMinimized |
| 34 | author { |
| 35 | login |
| 36 | } |
| 37 | } |
| 38 | } |
| 39 | commits(last: 1) { |
| 40 | nodes { |
| 41 | commit { |
| 42 | statusCheckRollup { |
| 43 | state |
| 44 | } |
| 45 | } |
| 46 | } |
| 47 | } |
| 48 | stack @include(if: $stacks) { |
| 49 | number |
| 50 | size |
| 51 | baseRefName |
| 52 | } |
| 53 | stackEntry @include(if: $stacks) { |
| 54 | position |
| 55 | } |
| 56 | } |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | query PullRequestStats($owner: String!, $name: String!, $number: Int!) { |
| 61 | repository(owner: $owner, name: $name) { |
| 62 | pullRequest(number: $number) { |
| 63 | additions |
| 64 | deletions |
| 65 | } |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | query PullRequestStackMembership($owner: String!, $name: String!, $number: Int!) { |
| 70 | repository(owner: $owner, name: $name) { |
| 71 | pullRequest(number: $number) { |
| 72 | stack { |
| 73 | number |
| 74 | size |
| 75 | baseRefName |
| 76 | } |
| 77 | stackEntry { |
| 78 | position |
| 79 | } |
| 80 | } |
| 81 | } |
| 82 | } |
| 83 | |
| 84 | # What a pull request watch needs to notice. Comments come most recently updated first, since an |
| 85 | # edit moves `updatedAt`, so an edit to an old comment on a long pull request is still in the page. |
| 86 | # Reviews have no such order: an edit to a review older than the last hundred waits for the |
| 87 | # watch's periodic full read, as do edits to comments inside review threads. |
| 88 | query PullRequestWatchFingerprint( |
| 89 | $owner: String! |
| 90 | $name: String! |
| 91 | $number: Int! |
| 92 | $mergeQueue: Boolean! |
| 93 | ) { |
| 94 | repository(owner: $owner, name: $name) { |
| 95 | pullRequest(number: $number) { |
| 96 | state |
| 97 | mergeable |
| 98 | headRefOid |
| 99 | comments(first: 100, orderBy: { field: UPDATED_AT, direction: DESC }) { |
| 100 | totalCount |
| 101 | nodes { |
| 102 | lastEditedAt |
| 103 | } |
| 104 | } |
| 105 | reviews(last: 100) { |
| 106 | totalCount |
| 107 | nodes { |
| 108 | lastEditedAt |
| 109 | } |
| 110 | } |
| 111 | reviewThreads { |
| 112 | totalCount |
| 113 | } |
| 114 | # totalCount ignores itemTypes and counts every timeline item; filteredCount honours it. |
| 115 | mergeQueueRemovals: timelineItems(itemTypes: [REMOVED_FROM_MERGE_QUEUE_EVENT]) |
| 116 | @include(if: $mergeQueue) { |
| 117 | filteredCount |
| 118 | } |
| 119 | commits(last: 1) { |
| 120 | nodes { |
| 121 | commit { |
| 122 | statusCheckRollup { |
| 123 | contexts { |
| 124 | checkRunCountsByState { |
| 125 | state |
| 126 | count |
| 127 | } |
| 128 | statusContextCountsByState { |
| 129 | state |
| 130 | count |
| 131 | } |
| 132 | } |
| 133 | } |
| 134 | } |
| 135 | } |
| 136 | } |
| 137 | } |
| 138 | } |
| 139 | } |