Unable to submit a pull request review comment

Hey,

here’s the mutation that I’m using:

mutation {
    addPullRequestReviewComment(input: {
      pullRequestReviewId: "${ pullRequestReviewId }",
      inReplyTo: "${ inReplyTo }",
      path: "${ path }",
      position: ${ position },
      body: "${ body }"
    }) {
      comment {
        __typename
        id
      }
    }
  }

What I’m getting back is Review has already been submitted.. The pullRequestReviewId is indeed an id of a already submitted pull request review but I’m not sure what to do. 

I did submit a comment as a reply in a pull request review comment thread via the UI of github.com and examine the response that I’m getting back. I notice that all the replies are actually attached to different pullRequestReviewId. Is that mean that I have to create a new pull request review for every reply? If yes, is it by using the addPullRequestReview mutation?

Hi @krasimir,

Thanks a lot for being here! Because it’s already been submitted, you can’t submit it again. A submitted review is one which has a state different than PENDING. If it’s in a non-pending state, then it’s been submitted to some state and you can’t change that state. You can only create a new review in a pending state and then submit that as an approval. The same is true in the UI – you can’t change an existing review from one state (changes_requested) to another (approved). You need to create a new review for the approval.

Thank you for the answer. What I wanted to do is to send a reply to a pull request review like it is possible in GitHub’s UI. Later while scaning the response from the API I noticed that even if I use the GitHub interface I’m getting my replyies attached to a different pull request review. Their replyTo field is correctly set but the pullRequestReviewId is not the same. So, what I ended up doing is to submit a pull request review with type COMMENT with my replies.

1 Like