GraphQL API should have a isDraft field for Pull Requests

It’s currently not possible to tell if the pull request is a draft or not via api v4.

API v3 returns a draft field.

Thanks for the feedback! I’ve taken your suggestion and passed it along to the appropriate teams. Thanks again for reaching out :grinning:

Could you bump this suggestion please? It’s such a simple one, and annoying to have to make new api requests to the old api to get this info.

This is now available under Preview by passing the application/vnd.github.shadow-cat-preview+json  Accept header: https://developer.github.com/v4/previews/#draft-pull-requests-preview

Example query:

{
  pr: resource(url: "https://github.com/react-spring/react-spring/pull/808") {
    ... on PullRequest {
      title
      isDraft
    }
  }
}

Response:

{
  "data": {
    "pr": {
      "title": "feat: add SpringValue class",
      "isDraft": true
    }
  }
}
1 Like