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§
- Fake
Graphql - Stub outbound GraphQL by query substring; records every call.
- GraphQl
- GraphQL plugin. Prefer
GraphQl::client/GraphQl::fake; server mount is optional. - Graph
QlBound - Graph
QlClient - Shared client stored in app state.
- Graphql
Call - Graphql
Response - Full GraphQL HTTP response JSON (
data+ optionalerrors).