Repository navigation
Expand file tree
/
Copy pathpullRequestMutations.graphql
More file actions
233 lines (210 loc) · 5.78 KB
/
Copy pathpullRequestMutations.graphql
File metadata and controls
233 lines (210 loc) · 5.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
# Writes to a pull request and the remarks on it. Only pull request actions read their answer back,
# so clients can show the result without another read.
fragment PullRequestActionSummary on PullRequest {
number
title
url
headRefName
baseRefName
state
isDraft
updatedAt
mergedAt
closedAt
headRefOid
author {
login
avatarUrl
... on User {
name
}
}
autoMergeRequest {
mergeMethod
}
}
mutation AddReviewThreadReply($threadId: ID!, $body: String!) {
addPullRequestReviewThreadReply(input: { pullRequestReviewThreadId: $threadId, body: $body }) {
comment {
id
}
}
}
# Without `$body` GitHub keeps the summary the pending review already has; an empty string clears it.
mutation SubmitPendingReview($reviewId: ID!, $event: PullRequestReviewEvent!, $body: String) {
submitPullRequestReview(input: { pullRequestReviewId: $reviewId, event: $event, body: $body }) {
pullRequestReview {
id
}
}
}
mutation AddReaction($subjectId: ID!, $content: ReactionContent!) {
addReaction(input: { subjectId: $subjectId, content: $content }) {
reaction {
content
}
}
}
mutation RemoveReaction($subjectId: ID!, $content: ReactionContent!) {
removeReaction(input: { subjectId: $subjectId, content: $content }) {
reaction {
content
}
}
}
mutation ResolveReviewThread($threadId: ID!) {
resolveReviewThread(input: { threadId: $threadId }) {
thread {
isResolved
}
}
}
mutation UnresolveReviewThread($threadId: ID!) {
unresolveReviewThread(input: { threadId: $threadId }) {
thread {
isResolved
}
}
}
# Rewrites the pull request's own words or its maintainer-edit setting. Every field is nullable so
# that one document serves any combination: a variable the request does not send puts no entry in
# the input at all, which leaves that field as it was rather than clearing it.
mutation UpdatePullRequest(
$pullRequestId: ID!
$title: String
$body: String
$maintainerCanModify: Boolean
) {
updatePullRequest(
input: {
pullRequestId: $pullRequestId
title: $title
body: $body
maintainerCanModify: $maintainerCanModify
}
) {
pullRequest {
id
}
}
}
# Creates a new pull request that reverses a merged pull request.
mutation RevertPullRequest($pullRequestId: ID!) {
revertPullRequest(input: { pullRequestId: $pullRequestId }) {
revertPullRequest {
id
}
}
}
# The two comment mutations name their comment differently; the variable is spelled the same in
# both, so a rewrite sends one set of variables whichever kind of remark it is.
mutation UpdateIssueComment($commentId: ID!, $body: String!) {
updateIssueComment(input: { id: $commentId, body: $body }) {
issueComment {
id
}
}
}
mutation UpdateReviewComment($commentId: ID!, $body: String!) {
updatePullRequestReviewComment(input: { pullRequestReviewCommentId: $commentId, body: $body }) {
pullRequestReviewComment {
id
}
}
}
# Clears one file, or puts it back. GitHub has no bulk form of either mutation, so
# `GraphQLResolver.aliased` repeats this under an alias per file and a burst of ticks is one
# request; `$viewed` picks which of the two each alias runs.
mutation SetFileViewed($pullRequestId: ID!, $path: String!, $viewed: Boolean!) {
markFileAsViewed(input: { pullRequestId: $pullRequestId, path: $path }) @include(if: $viewed) {
clientMutationId
}
unmarkFileAsViewed(input: { pullRequestId: $pullRequestId, path: $path }) @skip(if: $viewed) {
clientMutationId
}
}
mutation MergePullRequest($input: MergePullRequestInput!) {
mergePullRequest(input: $input) {
pullRequest {
...PullRequestActionSummary
}
}
}
mutation EnablePullRequestAutoMerge($input: EnablePullRequestAutoMergeInput!) {
enablePullRequestAutoMerge(input: $input) {
pullRequest {
...PullRequestActionSummary
}
}
}
mutation DisablePullRequestAutoMerge($pullRequestId: ID!) {
disablePullRequestAutoMerge(input: { pullRequestId: $pullRequestId }) {
pullRequest {
...PullRequestActionSummary
}
}
}
# Its own document: Enterprise Server rejects `includeStack` wherever it is named.
mutation DisableStackAutoMerge($pullRequestId: ID!) {
disablePullRequestAutoMerge(input: { pullRequestId: $pullRequestId, includeStack: true }) {
pullRequest {
...PullRequestActionSummary
}
}
}
mutation UpdatePullRequestBranch(
$pullRequestId: ID!
$expectedHeadOid: GitObjectID!
$updateMethod: PullRequestBranchUpdateMethod!
) {
updatePullRequestBranch(
input: {
pullRequestId: $pullRequestId
expectedHeadOid: $expectedHeadOid
updateMethod: $updateMethod
}
) {
pullRequest {
...PullRequestActionSummary
}
}
}
mutation MarkPullRequestReadyForReview($pullRequestId: ID!) {
markPullRequestReadyForReview(input: { pullRequestId: $pullRequestId }) {
pullRequest {
...PullRequestActionSummary
}
}
}
mutation ConvertPullRequestToDraft($pullRequestId: ID!) {
convertPullRequestToDraft(input: { pullRequestId: $pullRequestId }) {
pullRequest {
...PullRequestActionSummary
}
}
}
mutation ClosePullRequest($pullRequestId: ID!) {
closePullRequest(input: { pullRequestId: $pullRequestId }) {
pullRequest {
...PullRequestActionSummary
}
}
}
mutation ReopenPullRequest($pullRequestId: ID!) {
reopenPullRequest(input: { pullRequestId: $pullRequestId }) {
pullRequest {
...PullRequestActionSummary
}
}
}
mutation AddComment($subjectId: ID!, $body: String!) {
addComment(input: { subjectId: $subjectId, body: $body }) {
clientMutationId
}
}
# Deletes a branch only while it still points at `beforeOid`, which `refUpdates` carries.
mutation DeletePullRequestBranch($input: UpdateRefsInput!) {
updateRefs(input: $input) {
clientMutationId
}
}