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

GraphQL API should have a isDraft field for Pull Requests

Solved! Go to Solution.

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.

3 Replies
Community Manager
Message 2 of 4

Re: GraphQL API should have a isDraft field for Pull Requests

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


Best,
AndreaG

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

Pilot Lvl 1
Message 3 of 4

Re: GraphQL API should have a isDraft field for Pull Requests

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.

Solution
Pilot Lvl 1
Message 4 of 4

Re: GraphQL API should have a isDraft field for Pull Requests

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
    }
  }
}