An ergonomic, Shopify API Client for Rust.
This asynchronous example uses Tokio and enables some
optional features, so your Cargo.toml
could look like this:
toml
[dependencies]
shopify_api = "0.3"
tokio = { version = "1", features = ["full"] }
And then the code:
```rust,norun use shopifyapi::*; use shopify_api::utils::ReadJsonTreeSteps; use serde::{Deserialize};
struct Shop { name: String, }
async fn main() -> Result<(), Box
let graphql_query = r#" query { shop { name } }"#;
let variables = serdejson::json!({}); let jsonfinder = vec![ReadJsonTreeSteps::Key("data"), ReadJsonTreeSteps::Key("shop")];
let shop: Shop = shopify.graphqlquery(graphqlquery, &variables, &json_finder).await.unwrap(); Ok(()) } ```
Licensed under MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)