Skip to content

Commit ea1d0f7

Browse files
committed
WIP: Add review creation using GraphQL API
1 parent 7e6fe26 commit ea1d0f7

File tree

8 files changed

+35981
-77
lines changed

8 files changed

+35981
-77
lines changed

app/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ repositories {
1919
}
2020

2121
apply plugin: 'com.android.application'
22+
apply plugin: 'com.apollographql.android'
2223

2324
if (isPlaystore) {
2425
apply plugin: 'io.fabric'
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
mutation AddPullRequestReviewCommentMutation(
2+
$pullRequestReviewId: ID!,
3+
$commitOID: GitObjectID,
4+
$body: String!,
5+
$path: String,
6+
$position: Int,
7+
$inReplyTo: ID
8+
) {
9+
addPullRequestReviewComment(input: {
10+
pullRequestReviewId: $pullRequestReviewId,
11+
commitOID: $commitOID,
12+
body: $body,
13+
path: $path,
14+
position: $position,
15+
inReplyTo: $inReplyTo
16+
}) {
17+
comment {
18+
body
19+
}
20+
}
21+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
mutation AddPullRequestReviewMutation(
2+
$pullRequestId: ID!,
3+
$comments: [DraftPullRequestReviewComment]!
4+
) {
5+
addPullRequestReview(input: {
6+
pullRequestId: $pullRequestId,
7+
comments: $comments
8+
}) {
9+
pullRequestReview {
10+
id
11+
}
12+
}
13+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
query PullRequestPendingReviewQuery(
2+
$owner: String!,
3+
$repo: String!,
4+
$prNumber: Int!
5+
) {
6+
repository(owner: $owner, name: $repo) {
7+
pullRequest(number: $prNumber) {
8+
id
9+
reviews(states: PENDING, first: 1) {
10+
nodes {
11+
id
12+
}
13+
}
14+
}
15+
}
16+
}

0 commit comments

Comments
 (0)