Skip to content

Commit

Permalink
Workaround for #167.
Browse files Browse the repository at this point in the history
Same technic (manually copied and patched query) than for #203.
  • Loading branch information
Zimmi48 committed Mar 7, 2022
1 parent 6038e7d commit 548058f
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions bot-components/GitHub_queries.ml
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,48 @@ let issue_closer_info_of_resp ~owner ~repo ~number resp =

let get_issue_closer_info ~bot_info ({owner; repo; number} : issue) =
let open GitHub_GraphQL.Issue_Milestone.IssueMilestone in
(* Workaround for #167 until teamwalnut/graphql-ppx#270 is fixed. *)
let query =
"query issueMilestone($owner: String!, $repo: String!, $number: Int!) {\n\
\ repository(owner: $owner, name: $repo) {\n\
\ issue(number: $number) {\n\
\ id\n\
\ milestone {\n\
\ ...Milestone\n\
\ }\n\
\ timelineItems(itemTypes: [CLOSED_EVENT], last: 1) {\n\
\ nodes {\n\
\ __typename\n\
\ ...on ClosedEvent {\n\
\ closer {\n\
\ __typename\n\
\ ...on PullRequest {\n\
\ ...PullRequest\n\
\ }\n\
\ ...on Commit {\n\
\ associatedPullRequests(first: 2) {\n\
\ nodes {\n\
\ ...PullRequest\n\
\ }\n\
\ }\n\
\ }\n\
\ }\n\
\ }\n\
\ }\n\
\ }\n\
\ }\n\
\ }\n\
\ }\n\
\ fragment Milestone on Milestone {\n\
\ id\n\
\ }\n\
\ fragment PullRequest on PullRequest {\n\
\ id\n\
\ milestone {\n\
\ ...Milestone\n\
\ }\n\
\ }"
in
makeVariables ~owner ~repo ~number ()
|> serializeVariables |> variablesToJson
|> GraphQL_query.send_graphql_query ~bot_info ~query
Expand Down

0 comments on commit 548058f

Please sign in to comment.