Skip to content

Commit

Permalink
Load pull request draft status from GraphQL API (#742)
Browse files Browse the repository at this point in the history
Back in 2019, we disabled this field because it was part of a GraphQL
preview. As a result, IsDraft was always false for PRs that we loaded
via the GraphQL query. For the most part, this doesn't matter, but can
cause problems with reviewer requests triggered via webhooks (like
status events) that do not provide complete pull request details.

This field has been out of preview for a long time now and is available
in all supported versions of GitHub, so it should be safe to load.
  • Loading branch information
bluekeyes committed Mar 26, 2024
1 parent bdb61df commit 1000bcf
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions pull/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -1000,9 +1000,7 @@ type v4PullRequest struct {
State string

IsCrossRepository bool

// This field is in GraphQL Preview, so don't ask for it just yet
IsDraft bool `graphql:""`
IsDraft bool

HeadRefOID string
HeadRefName string
Expand Down

0 comments on commit 1000bcf

Please sign in to comment.