Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PullRequest lacks IsDraft field #66

Open
BlackVegetable opened this issue May 28, 2020 · 2 comments
Open

PullRequest lacks IsDraft field #66

BlackVegetable opened this issue May 28, 2020 · 2 comments
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.

Comments

@BlackVegetable
Copy link

BlackVegetable commented May 28, 2020

The IsDraft field appears to exist for PullRequests in the graphql v4 docs:

Screen Shot 2020-05-28 at 9 47 22 AM

However, when querying for it I am given this response: GHE GraphQL query error: Field 'isDraft' doesn't exist on type 'PullRequest' I'm running GHE 2.20.7 and the April 13th, 2020 commit/release of this repo. This information is available via the v3 API.

Googling around a little showed that some folks were having to use a preview header to get this data via v4. But that information was a little dated.

Any suggestions on how we could add support for this here?

@dmitshur
Copy link
Member

dmitshur commented May 29, 2020

I'm running GHE 2.20.7

You should use the Versions dropdown to select documentation for that version:

It'll take you to:

https://developer.github.com/enterprise/2.20/v4/object/pullrequest/#isdraft

It's documented for that version that it's currently in preview and requires an Accept header for "Draft Pull Requests Preview" to provided:

https://developer.github.com/enterprise/2.20/v4/previews/#draft-pull-requests-preview

The tracking issue for schema support preview is #34, but there hasn't been recent progress there. You should be able to use a custom http.RoundTripper wrapper to insert that header as an interim solution.

@dmitshur dmitshur added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label May 29, 2020
@BlackVegetable
Copy link
Author

Adding a RoundTripper with that header definitely did the trick, btw.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Development

No branches or pull requests

2 participants