pub fn respond(resp: impl Into<async_graphql::BatchResponse>) -> tide::Result {
    let resp = resp.into();

    let mut response = Response::new(StatusCode::Ok);
    if resp.is_ok() {
        if let Some(cache_control) = resp.cache_control().value() {
            response.insert_header(headers::CACHE_CONTROL, cache_control);
        }
    }
    for (name, value) in resp.http_headers() {
        response.append_header(name, value);
    }
    response.set_body(Body::from_json(&resp)?);
    Ok(response)
}
/// Convert a GraphQL response to a Tide response.
Convert a GraphQL response to a Tide response.
Convert a GraphQL response to a Tide response .
pub fn respond(resp: impl Into<async_graphql::BatchResponse>) -> tide::Result {
    let resp = resp.into();
    let mut response = Response::new(StatusCode::Ok);
    if resp.is_ok() {
        if let Some(cache_control) = resp.cache_control().value() {
            response.insert_header(headers::CACHE_CONTROL, cache_control);
        }
    }
    for (name, value) in resp.http_headers() {
        response.append_header(name, value);
    }
    response.set_body(Body::from_json(&resp)?);
    Ok(response)
}
pub fn respond ( resp : impl Into < async_graphql :: BatchResponse > ) -> tide :: Result { let resp = resp . into ( ) ; let mut response = Response :: new ( StatusCode :: Ok ) ; if resp . is_ok ( ) { if let Some ( cache_control ) = resp . cache_control ( ) . value ( ) { response . insert_header ( headers :: CACHE_CONTROL , cache_control ) ; } } for ( name , value ) in resp . http_headers ( ) { response . append_header ( name , value ) ; } response . set_body ( Body :: from_json ( & resp ) ? ) ; Ok ( response ) }
Convert a GraphQL response to a Tide response.
Convert a GraphQL response to a Tide response .
resp
impl Into<async_graphql::BatchResponse>
resp
impl Into<async_graphql::BatchResponse>