shopify_api

crates.io Documentation MIT/Apache-2 licensed CI Issues

An ergonomic, Shopify API Client for Rust.

Example

This asynchronous example uses Tokio and enables some optional features, so your Cargo.toml could look like this:

toml [dependencies] shopify_api = "0.2" tokio = { version = "1", features = ["full"] }

And then the code:

```rust,norun use shopifyapi::*; use shopify_api::utils::ReadJsonTreeSteps; use serde::{Deserialize};

[derive(Deserialize)]

struct Shop { name: String, }

[tokio::main]

async fn main() -> Result<(), Box> { let shopify = Shopify::new("hello", "world", ShopifyAPIVersion::V2023_01, None);

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(()) } ```

License

Licensed under MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)