File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed
Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change 1+ const gql = require ( 'fake-tag' ) ;
2+
3+ const { graphql } = require ( '@octokit/graphql' ) ;
4+
5+ const authenticatedGraphql = graphql . defaults ( {
6+ headers : {
7+ authorization : `token ${ process . env . TOKEN } `
8+ }
9+ } ) ;
10+
11+ const convertToDraftQuery = gql `
12+ mutation ConvertToDraft($pull_id: ID!) {
13+ convertPullRequestToDraft(input: { pullRequestId: $pull_id }) {
14+ pullRequest {
15+ updatedAt
16+ }
17+ }
18+ }
19+ ` ;
20+
21+ const markReadyForReviewQuery = gql `
22+ mutation MarkReadyForReview($pull_id: ID!) {
23+ markPullRequestReadyForReview(input: { pullRequestId: $pull_id }) {
24+ pullRequest {
25+ updatedAt
26+ }
27+ }
28+ }
29+ ` ;
30+
31+ authenticatedGraphql ( markReadyForReviewQuery , { "pull_id" : "MDExOlB1bGxSZXF1ZXN0MzI3NTkzNTc2" } ) . then ( result => {
32+ console . log ( result ) ;
33+ } ) . catch ( err => {
34+ console . error ( err ) ;
35+ } ) ;
You can’t perform that action at this time.
0 commit comments