INNER CODE UNIT · Rust
get_conn_from_ctx
rkudryashov/graphql-rust-demo · planets-service/src/lib.rs:87
pub fn get_conn_from_ctx(ctx: &Context<'_>) -> PooledConnection<ConnectionManager<PgConnection>> {
ctx.data::<Arc<PgPool>>()
.expect("Can't get pool")
.get()
.expect("Can't get DB connection")
}