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

pullRequestMutations.graphql

175 lines4.6 KB

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