[Bug] API V4(GraphQL): Unable to reply to comments of already submitted PR reviews.

Hello forum,

I want to use the GraphQL API to reply to a pull request review comment.

It is possible if the status of the review is PENDING, when the status of the review is SUBMITTED, it is not.
When I try it over the UI, everything works fine.

Here is my mutation request:

mutation {
  addPullRequestReviewComment(
    input: {
      pullRequestReviewId: $pullRequestReviewId,
      inReplyTo: $commentToReplyTo,
      body: "test comment"
    }) {
        clientMutationId
        comment{
          body
     }
  }
}

This is the response I get:

{
  "data": {
    "addPullRequestReviewComment": null
  },
  "errors": [
    {
      "type": "VALIDATION",
      "path": [
        "addPullRequestReviewComment"
      ],
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "message": "Review has already been submitted."
    }
  ]
}

I hope someone can help me, thank you.

1 Like

Hi @lionellindt,

Thanks for being here! I’m able to update a submitted comment by using the query FindReview and mutation UpdateReview, here is my sample query:

query FindReview {
  repository(owner: "andreagriffiths11", name: "graphql-test") {
    pullRequest(number: 1) {
      reviews(first: 100) {
        edges {
          node {
            id
          }
        }
      }
    }
  }
}

mutation UpdateReview {
  updatePullRequestReview(input: {pullRequestReviewId: "MDE3OlB1bGxSZXF1ZXN0UmV2aWV3MjI2MzYxNTA3", body: "New comment"}) {
    pullRequestReview {
      updatedAt
    }
  }
}

I hope this helps!

Hi @andreagriffiths11,

Thank you for your answer! 
Maybe I did not explain my situation clear enough. My goal is not to update a submitted PR-review comment, but to reply to one.

I hope this clarifies my problem :slightly_smiling_face:

Hey @lionellindt ,

Thanks for the clarification, the same method it would post a reply to the PR. Does that make sense?

Hey @andreagriffiths11,

I have tried your query but I was really not able to reply to another review comment. :confused:

The image below should demonstrate and example of what I am trying to accomplish. I want to reply to another review comment, just like dhh did. And the red arrow marks, where it is possible to do over the gui.

1 Like

Hey all,

@lionellindt  were you able to solve this?

@andreagriffiths11 could you look into it again?

We are facing the exact same issue. We tried removing

inReplyTo: $commentToReplyTo`

 field, but it didn’t help.