gql_client 1.1.0

Minimal GraphQL client for Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use reqwest::Url;
use std::str::FromStr;

#[test]
fn test_url() {
  let url_raw = "https://subql.darwinia.network/subql-bridger-darwinia";
  let url = Url::from_str(url_raw).unwrap();
  let schema = url.scheme();
  let host = url.host().unwrap();
  assert_eq!(
    "https://subql.darwinia.network",
    format!("{}://{}", schema, host)
  );
}