debug-get-author-2
This commit is contained in:
parent
39c4cf2d2a
commit
e01c014ed1
|
@ -10,8 +10,8 @@ use crate::SSEMessageData;
|
|||
|
||||
async fn get_author_id(user: &str) -> Result<i32, Box<dyn Error>> {
|
||||
let api_base = env::var("API_BASE")?;
|
||||
let query_name = "get_author";
|
||||
let operation = "GetAuthor";
|
||||
let query_name = "get_author_id";
|
||||
let operation = "GetAuthorId";
|
||||
let mut headers = HeaderMap::new();
|
||||
// headers.insert(AUTHORIZATION, HeaderValue::from_str(token)?);
|
||||
headers.insert(CONTENT_TYPE, HeaderValue::from_static("application/json"));
|
||||
|
@ -20,7 +20,7 @@ async fn get_author_id(user: &str) -> Result<i32, Box<dyn Error>> {
|
|||
variables.insert("user".to_string(), user.to_string());
|
||||
|
||||
let gql = json!({
|
||||
"query": format!("query {}($slug: String, $user: String, $author_id: Int) {{ {}(slug: $slug, user: $user, author_id: $author_id){{ id }} }}", operation, query_name),
|
||||
"query": format!("query {}($user: String!) {{ {}(user: $user){{ id }} }}", operation, query_name),
|
||||
"operationName": operation,
|
||||
"variables": variables
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue
Block a user