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

Get pull request that was just merged?

Hi,
I'm trying to use GraphQL API to search for a Pull Request that was just merged to base branch (master). I am trying to figure out what's the best way to do this, but I wanted to try to search the Pull Request by its merge commit SHA. I already have the latest commit from master, and I want to find the Pull Request that has the same commit.

I'm still new to GraphQL but this is what I tried so far:

{
repository(owner: "octocat", name: "Hello-World") {
pullRequests(states: MERGED, first: 1, mergeCommit: "$sha", baseRefName: "master") {
edges {
node {
title
body
}
}
}
}
}


I'm getting this error: Field 'pullRequests' doesn't accept argument 'mergeCommit'. Not sure what the right syntax for this is.