(token: Option<&str>, api_url: String)
| 97 | } |
| 98 | |
| 99 | fn build_gql_api_client(token: Option<&str>, api_url: String) -> GQLClient { |
| 100 | let headers = match token { |
| 101 | Some(token) => { |
| 102 | let mut headers = std::collections::HashMap::new(); |
| 103 | headers.insert("Authorization".to_string(), token.to_owned()); |
| 104 | headers |
| 105 | } |
| 106 | None => Default::default(), |
| 107 | }; |
| 108 | |
| 109 | GQLClient::new_with_config(ClientConfig { |
| 110 | endpoint: api_url, |
| 111 | // Slightly high to account for cold starts |
| 112 | timeout: Some(20), |
| 113 | headers: Some(headers), |
| 114 | proxy: None, |
| 115 | }) |
| 116 | } |
| 117 | |
| 118 | nest! { |
| 119 | #[derive(Debug, Deserialize, Serialize)]* |
no outgoing calls
no test coverage detected