Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

pullRequestBatches.graphql

128 lines2.9 KB

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 author {
34 login
35 }
36 }
37 }
38 commits(last: 1) {
39 nodes {
40 commit {
41 statusCheckRollup {
42 state
43 }
44 }
45 }
46 }
47 stack @include(if: $stacks) {
48 number
49 size
50 baseRefName
51 }
52 stackEntry @include(if: $stacks) {
53 position
54 }
55 }
56 }
58​
59query PullRequestStats($owner: String!, $name: String!, $number: Int!) {
60 repository(owner: $owner, name: $name) {
61 pullRequest(number: $number) {
62 additions
63 deletions
64 }
65 }
67​
68query PullRequestStackMembership($owner: String!, $name: String!, $number: Int!) {
69 repository(owner: $owner, name: $name) {
70 pullRequest(number: $number) {
71 stack {
72 number
73 size
74 baseRefName
75 }
76 stackEntry {
77 position
78 }
79 }
80 }
82​
83# What a pull request watch needs to notice. Comments come most recently updated first, since an
84# edit moves `updatedAt`, so an edit to an old comment on a long pull request is still in the page.
85# Reviews have no such order: an edit to a review older than the last hundred waits for the
86# watch's periodic full read, as do edits to comments inside review threads.
87query PullRequestWatchFingerprint($owner: String!, $name: String!, $number: Int!) {
88 repository(owner: $owner, name: $name) {
89 pullRequest(number: $number) {
90 state
91 mergeable
92 headRefOid
93 comments(first: 100, orderBy: { field: UPDATED_AT, direction: DESC }) {
94 totalCount
95 nodes {
96 lastEditedAt
97 }
98 }
99 reviews(last: 100) {
100 totalCount
101 nodes {
102 lastEditedAt
103 }
104 }
105 reviewThreads {
106 totalCount
107 }
108 commits(last: 1) {
109 nodes {
110 commit {
111 statusCheckRollup {
112 contexts {
113 checkRunCountsByState {
114 state
115 count
116 }
117 statusContextCountsByState {
118 state
119 count
120 }
121 }
122 }
123 }
124 }
125 }
126 }
127 }