Open History to see the last commit
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
5query 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
60query 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
69query 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.
88query PullRequestWatchFingerprint($owner: String!, $name: String!, $number: Int!) {
89 repository(owner: $owner, name: $name) {
90 pullRequest(number: $number) {
91 state
92 mergeable
93 headRefOid
94 comments(first: 100, orderBy: { field: UPDATED_AT, direction: DESC }) {
95 totalCount
96 nodes {
97 lastEditedAt
98 }
99 }
100 reviews(last: 100) {
101 totalCount
102 nodes {
103 lastEditedAt
104 }
105 }
106 reviewThreads {
107 totalCount
108 }
109 commits(last: 1) {
110 nodes {
111 commit {
112 statusCheckRollup {
113 contexts {
114 checkRunCountsByState {
115 state
116 count
117 }
118 statusContextCountsByState {
119 state
120 count
121 }
122 }
123 }
124 }
125 }
126 }
127 }
128 }
129}