Open History to see the last commit
1# Writes to a pull request and the remarks on it. None reads its answer back beyond what GitHub
2# requires a mutation to select.
3
4mutation AddReviewThreadReply($threadId: ID!, $body: String!) {
5 addPullRequestReviewThreadReply(input: { pullRequestReviewThreadId: $threadId, body: $body }) {
6 comment {
7 id
8 }
9 }
10}
11
12mutation AddReaction($subjectId: ID!, $content: ReactionContent!) {
13 addReaction(input: { subjectId: $subjectId, content: $content }) {
14 reaction {
15 content
16 }
17 }
18}
19
20mutation RemoveReaction($subjectId: ID!, $content: ReactionContent!) {
21 removeReaction(input: { subjectId: $subjectId, content: $content }) {
22 reaction {
23 content
24 }
25 }
26}
27
28mutation ResolveReviewThread($threadId: ID!) {
29 resolveReviewThread(input: { threadId: $threadId }) {
30 thread {
31 isResolved
32 }
33 }
34}
35
36mutation UnresolveReviewThread($threadId: ID!) {
37 unresolveReviewThread(input: { threadId: $threadId }) {
38 thread {
39 isResolved
40 }
41 }
42}
43
44# Rewrites the pull request's own words. Both are nullable so that one document serves a change to
45# the title, to the description, or to the two together: a variable the request does not send puts
46# no entry in the input at all, which leaves that field as it was rather than clearing it.
47mutation UpdatePullRequest($pullRequestId: ID!, $title: String, $body: String) {
48 updatePullRequest(input: { pullRequestId: $pullRequestId, title: $title, body: $body }) {
49 pullRequest {
50 id
51 }
52 }
53}
54
55# Creates a new pull request that reverses a merged pull request.
56mutation RevertPullRequest($pullRequestId: ID!) {
57 revertPullRequest(input: { pullRequestId: $pullRequestId }) {
58 revertPullRequest {
59 id
60 }
61 }
62}
63
64# The two comment mutations name their comment differently; the variable is spelled the same in
65# both, so a rewrite sends one set of variables whichever kind of remark it is.
66mutation UpdateIssueComment($commentId: ID!, $body: String!) {
67 updateIssueComment(input: { id: $commentId, body: $body }) {
68 issueComment {
69 id
70 }
71 }
72}
73
74mutation UpdateReviewComment($commentId: ID!, $body: String!) {
75 updatePullRequestReviewComment(input: { pullRequestReviewCommentId: $commentId, body: $body }) {
76 pullRequestReviewComment {
77 id
78 }
79 }
80}
81
82# Clears one file, or puts it back. GitHub has no bulk form of either mutation, so
83# `GraphQLResolver.aliased` repeats this under an alias per file and a burst of ticks is one
84# request; `$viewed` picks which of the two each alias runs.
85mutation SetFileViewed($pullRequestId: ID!, $path: String!, $viewed: Boolean!) {
86 markFileAsViewed(input: { pullRequestId: $pullRequestId, path: $path }) @include(if: $viewed) {
87 clientMutationId
88 }
89 unmarkFileAsViewed(input: { pullRequestId: $pullRequestId, path: $path }) @skip(if: $viewed) {
90 clientMutationId
91 }
92}
93
94mutation MergePullRequest($input: MergePullRequestInput!) {
95 mergePullRequest(input: $input) {
96 clientMutationId
97 }
98}
99
100mutation EnablePullRequestAutoMerge($input: EnablePullRequestAutoMergeInput!) {
101 enablePullRequestAutoMerge(input: $input) {
102 clientMutationId
103 }
104}
105
106mutation DisablePullRequestAutoMerge($pullRequestId: ID!) {
107 disablePullRequestAutoMerge(input: { pullRequestId: $pullRequestId }) {
108 clientMutationId
109 }
110}
111
112mutation UpdatePullRequestBranch(
113 $pullRequestId: ID!
114 $expectedHeadOid: GitObjectID!
115 $updateMethod: PullRequestBranchUpdateMethod!
116) {
117 updatePullRequestBranch(
118 input: {
119 pullRequestId: $pullRequestId
120 expectedHeadOid: $expectedHeadOid
121 updateMethod: $updateMethod
122 }
123 ) {
124 clientMutationId
125 }
126}
127
128mutation MarkPullRequestReadyForReview($pullRequestId: ID!) {
129 markPullRequestReadyForReview(input: { pullRequestId: $pullRequestId }) {
130 clientMutationId
131 }
132}
133
134mutation ConvertPullRequestToDraft($pullRequestId: ID!) {
135 convertPullRequestToDraft(input: { pullRequestId: $pullRequestId }) {
136 clientMutationId
137 }
138}
139
140mutation ClosePullRequest($pullRequestId: ID!) {
141 closePullRequest(input: { pullRequestId: $pullRequestId }) {
142 clientMutationId
143 }
144}
145
146mutation ReopenPullRequest($pullRequestId: ID!) {
147 reopenPullRequest(input: { pullRequestId: $pullRequestId }) {
148 clientMutationId
149 }
150}
151
152mutation AddComment($subjectId: ID!, $body: String!) {
153 addComment(input: { subjectId: $subjectId, body: $body }) {
154 clientMutationId
155 }
156}
157
158# Deletes a branch only while it still points at `beforeOid`, which `refUpdates` carries.
159mutation DeletePullRequestBranch($input: UpdateRefsInput!) {
160 updateRefs(input: $input) {
161 clientMutationId
162 }
163}