REST or GraphQL API: How to get list of my open PRs to various projects

Hi All!

I am relatively new to the GitHub APIs (REST and GraphQL), so pardon me if this is a well-known question or known gap in functionality.

Question: How does one use the GitHub API to obtain a list of PRs that “self” has opened against various projects/repos?

Use-Case: I have opened multiple PRs recently to patch a security vulnerability and after some time I want to close them programmatically as I would consider them “stale”

I imagined there would be a way for me to query myself and from the response object either see a list that represents the metadata for each open PR or be provided with IDs with which to them perform an update request to close those respective PRs.

I look forward to learning from y’all!

  • Manny