fregante/github-issue-link-status

Support PR links with the /issues/# link

fregante opened this issue · 0 comments

I thought I opened an issue about this but... hmmm

GitHub redirects /issue/# links to /pull/#, but on GQL this is doesn't happen, so ILS queries either type depending on the URL.

Example link:

github.com/bfred-it/github-issue-link-status/issues/11

ILS can use the issueOrPullRequest union query with this (awkward) format:

{
  repository(owner: "bfred-it", name: "github-issue-link-status") {
    issueOrPullRequest(number: 1) {
      __typename
      ... on PullRequest {
        state
      }
      ... on Issue {
        state
      }
    }
  }
}

__typename would also let ILS pick the correct icon for the PR link once the query is completed.