api: serve gh pr over GraphQL and REST (#114)288e98ea day ago142 lines · 4.4 KB | 1 | [ |
| 2 | { |
| 3 | "command": "gh pr ready 4 -R <host>/<login>/tools --undo", |
| 4 | "requests": |
| 5 | { |
| 6 | "method": |
| 7 | "path": |
| 8 | "query": |
| 9 | "headers": |
| 10 | "accept": |
| 11 | "content-type": |
| 12 | "graphql-features": |
| 13 | "x-github-api-version": |
| 14 | }, |
| 15 | "body": |
| 16 | "query": |
| 17 | "variables": |
| 18 | "owner": |
| 19 | "pr_number": |
| 20 | "repo": |
| 21 | } |
| 22 | }, |
| 23 | "status": |
| 24 | }, |
| 25 | { |
| 26 | "method": |
| 27 | "path": |
| 28 | "query": |
| 29 | "headers": |
| 30 | "accept": |
| 31 | "content-type": |
| 32 | "graphql-features": |
| 33 | "x-github-api-version": |
| 34 | }, |
| 35 | "body": |
| 36 | "query": |
| 37 | "variables": |
| 38 | "input": |
| 39 | "pullRequestId": |
| 40 | } |
| 41 | } |
| 42 | }, |
| 43 | "status": |
| 44 | } |
| 45 | ] |
| 46 | }, |
| 47 | { |
| 48 | "command": |
| 49 | "requests": |
| 50 | { |
| 51 | "method": |
| 52 | "path": |
| 53 | "query": |
| 54 | "headers": |
| 55 | "accept": |
| 56 | "content-type": |
| 57 | "graphql-features": |
| 58 | "x-github-api-version": |
| 59 | }, |
| 60 | "body": |
| 61 | "query": |
| 62 | "variables": |
| 63 | "owner": |
| 64 | "pr_number": |
| 65 | "repo": |
| 66 | } |
| 67 | }, |
| 68 | "status": |
| 69 | } |
| 70 | ] |
| 71 | }, |
| 72 | { |
| 73 | "command": |
| 74 | "requests": |
| 75 | { |
| 76 | "method": |
| 77 | "path": |
| 78 | "query": |
| 79 | "headers": |
| 80 | "accept": |
| 81 | "content-type": |
| 82 | "graphql-features": |
| 83 | "x-github-api-version": |
| 84 | }, |
| 85 | "body": |
| 86 | "query": |
| 87 | "variables": |
| 88 | "owner": |
| 89 | "pr_number": |
| 90 | "repo": |
| 91 | } |
| 92 | }, |
| 93 | "status": |
| 94 | }, |
| 95 | { |
| 96 | "method": |
| 97 | "path": |
| 98 | "query": |
| 99 | "headers": |
| 100 | "accept": |
| 101 | "content-type": |
| 102 | "graphql-features": |
| 103 | "x-github-api-version": |
| 104 | }, |
| 105 | "body": |
| 106 | "query": |
| 107 | "variables": |
| 108 | "input": |
| 109 | "pullRequestId": |
| 110 | } |
| 111 | } |
| 112 | }, |
| 113 | "status": |
| 114 | } |
| 115 | ] |
| 116 | }, |
| 117 | { |
| 118 | "command": |
| 119 | "requests": |
| 120 | { |
| 121 | "method": |
| 122 | "path": |
| 123 | "query": |
| 124 | "headers": |
| 125 | "accept": |
| 126 | "content-type": |
| 127 | "graphql-features": |
| 128 | "x-github-api-version": |
| 129 | }, |
| 130 | "body": |
| 131 | "query": |
| 132 | "variables": |
| 133 | "owner": |
| 134 | "pr_number": |
| 135 | "repo": |
| 136 | } |
| 137 | }, |
| 138 | "status": |
| 139 | } |
| 140 | ] |
| 141 | } |
| 142 | ] |
[
"
POST
"
,
"
/api/graphql
"
,
{}
,
{
"
application/json
"
,
"
application/json; charset=utf-8
"
,
"
merge_queue
"
,
"
2022-11-28
"
{
"
\n\t
query PullRequestByNumber($owner: String!, $repo: String!, $pr_number: Int!) {
\n\t\t
repository(owner: $owner, name: $repo) {
\n\t\t\t
pullRequest(number: $pr_number) {id,number,state,isDraft}
\n\t\t
}
\n\t
}
"
,
{
"
<login>
"
,
4
,
"
tools
"
200
"
POST
"
,
"
/api/graphql
"
,
{}
,
{
"
application/json
"
,
"
application/json
"
,
"
merge_queue
"
,
"
2022-11-28
"
{
"
mutation ConvertPullRequestToDraft($input:ConvertPullRequestToDraftInput!){convertPullRequestToDraft(input: $input){pullRequest{id}}}
"
,
{
{
"
PR_<id>
"
200
"
gh pr view 4 -R <host>/<login>/tools --json isDraft
"
,
[
"
POST
"
,
"
/api/graphql
"
,
{}
,
{
"
application/json
"
,
"
application/json; charset=utf-8
"
,
"
merge_queue
"
,
"
2022-11-28
"
{
"
\n\t
query PullRequestByNumber($owner: String!, $repo: String!, $pr_number: Int!) {
\n\t\t
repository(owner: $owner, name: $repo) {
\n\t\t\t
pullRequest(number: $pr_number) {isDraft,id,number}
\n\t\t
}
\n\t
}
"
,
{
"
<login>
"
,
4
,
"
tools
"
200
"
gh pr ready 4 -R <host>/<login>/tools
"
,
[
"
POST
"
,
"
/api/graphql
"
,
{}
,
{
"
application/json
"
,
"
application/json; charset=utf-8
"
,
"
merge_queue
"
,
"
2022-11-28
"
{
"
\n\t
query PullRequestByNumber($owner: String!, $repo: String!, $pr_number: Int!) {
\n\t\t
repository(owner: $owner, name: $repo) {
\n\t\t\t
pullRequest(number: $pr_number) {id,number,state,isDraft}
\n\t\t
}
\n\t
}
"
,
{
"
<login>
"
,
4
,
"
tools
"
200
"
POST
"
,
"
/api/graphql
"
,
{}
,
{
"
application/json
"
,
"
application/json
"
,
"
merge_queue
"
,
"
2022-11-28
"
{
"
mutation PullRequestReadyForReview($input:MarkPullRequestReadyForReviewInput!){markPullRequestReadyForReview(input: $input){pullRequest{id}}}
"
,
{
{
"
PR_<id>
"
200
"
gh pr view 4 -R <host>/<login>/tools --json isDraft
"
,
[
"
POST
"
,
"
/api/graphql
"
,
{}
,
{
"
application/json
"
,
"
application/json; charset=utf-8
"
,
"
merge_queue
"
,
"
2022-11-28
"
{
"
\n\t
query PullRequestByNumber($owner: String!, $repo: String!, $pr_number: Int!) {
\n\t\t
repository(owner: $owner, name: $repo) {
\n\t\t\t
pullRequest(number: $pr_number) {isDraft,id,number}
\n\t\t
}
\n\t
}
"
,
{
"
<login>
"
,
4
,
"
tools
"
200