Skip to main content

Crate sova_graphql

Crate sova_graphql 

Source
Expand description

GraphQL for Sova — client + optional schema server mount.

use sova_graphql::{FakeGraphql, GraphQl, GraphQlExt};
use serde_json::json;

let fake = FakeGraphql::new().stub("hello", json!({ "hello": "world" }));
app.install(GraphQl::fake(fake.clone()));

// in a handler:
let v = req.graphql().query("query { hello }").data().await?;
assert_eq!(v["hello"], "world");

Structs§

FakeGraphql
Stub outbound GraphQL by query substring; records every call.
GraphQl
GraphQL plugin. Prefer GraphQl::client / GraphQl::fake; server mount is optional.
GraphQlBound
GraphQlClient
Shared client stored in app state.
GraphqlCall
GraphqlResponse
Full GraphQL HTTP response JSON (data + optional errors).

Enums§

GraphqlError

Traits§

GraphQlExt