Skip to content

Commit

Permalink
✨ Add working github call API
Browse files Browse the repository at this point in the history
  • Loading branch information
bizouarn committed Sep 12, 2022
1 parent f40d88d commit a4e861a
Showing 1 changed file with 7 additions and 24 deletions.
31 changes: 7 additions & 24 deletions src/status/services/Github.hx
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,7 @@ class Github implements IStatus{
#end

public function new(token:String){
trace((graphql:Any));
/*github = new graphql({
headers: {
authorization: 'token ${token}',
},
});*/
this.token = token;
}

public function setEmoji(emoji:String){
Expand All @@ -35,28 +30,16 @@ class Github implements IStatus{
}

public function publishStatus(){
var auth:String = 'bearer '+token;
var query:String = 'mutation{changeUserStatus(input:{emoji:"'+emoji+'",message:"'+message+'"}){status{message emoji}}}';
#if js
/*axios.post('https://api.github.com/graphql', {query:`query{__schema}`} ,{
axios.post('https://api.github.com/graphql', {
query : query
}, {
headers: {
'Authorization': "bear " + token,
'Content-Type': 'application/json'
'Authorization': auth
}
});
js.Syntax.code("
github(`mutation changeUserStatus ($input: ChangeUserStatusInput!) {
changeUserStatus (input: $input) {
status {
emoji
message
}
}
}`, {
input: {
message: msg,
emoji: (emoji)
}
})
*/
return "";
#else
return "Github publish TODO";
Expand Down

0 comments on commit a4e861a

Please sign in to comment.