Type Definition warpgrapher::engine::events::AfterRequestFunc
source · [−]pub type AfterRequestFunc<R> = fn(_: EventFacade<'_, R>, _: Value) -> BoxFuture<'_, Result<Value, Error>>;
Expand description
Type alias for a function called after request execution allowing modifications to the output value.
Examples
type Rctx = ();
fn after_request(
mut ef: EventFacade<Rctx>,
output: serde_json::Value,
) -> BoxFuture<'static, Result<serde_json::Value, warpgrapher::Error>> {
Box::pin(async move {
// modify output
Ok(output)
})
}