Change HTTPS provider
Some checks failed
Build App / Build (push) Failing after 3m23s

This commit is contained in:
2025-03-30 23:35:58 +02:00
parent 62ea45dc65
commit 0892415ab9
4 changed files with 1111 additions and 1517 deletions

View File

@@ -1,6 +1,6 @@
use crate::smashquery::{MyQuery, MyQueryVariables, Set, SetSlot,StreamQueue};
use cynic::{http::SurfExt, GraphQlResponse, QueryBuilder};
use cynic::{ GraphQlResponse, QueryBuilder};
//use futures::executor;
static URL_SMASH: &str = "https://api.start.gg/gql/alpha";
#[derive(Debug,Clone)]
@@ -30,20 +30,31 @@ impl SmashQueue{
Self { name:String::from(""),matches : vec![] }
}
}
fn build_query(tournament :&str) -> cynic::Operation<MyQuery,MyQueryVariables> {
MyQuery::build(MyQueryVariables
{
slug:Some(tournament)
} )
}
fn request_stream_queue(tournament :&str, key : &str ) -> GraphQlResponse<MyQuery>{
let resp = async_std::task::block_on(async {
// let resp = async_std::task::block_on(async {
let query = MyQuery::build(MyQueryVariables
{
slug:Some(tournament)
} );
let resp = surf::post(URL_SMASH).header("Authorization", key).run_graphql(query).await.unwrap();
return resp;
});
return resp;
let resp = reqwest::blocking::Client::new().post(URL_SMASH).header("Authorization", key).json(&query).send().unwrap();
return resp.json().unwrap();
// });
// return resp;
}