Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Copilot Lvl 2
Message 1 of 4

[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.

 

3 Replies
Community Manager
Message 2 of 4

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

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!

Mark helpful posts with Accept as Solution to help other users locate important info. Don't forget to give Kudos for great content!

Highlighted
Copilot Lvl 2
Message 3 of 4

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

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 🙂

Community Manager
Message 4 of 4

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

Hey @LionelLindt ,

 

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

Mark helpful posts with Accept as Solution to help other users locate important info. Don't forget to give Kudos for great content!