async_graphql/dynamic/
request.rsuse crate::{dynamic::FieldValue, Request};
pub struct DynamicRequest {
pub(crate) inner: Request,
pub(crate) root_value: FieldValue<'static>,
}
pub trait DynamicRequestExt {
fn root_value(self, value: FieldValue<'static>) -> DynamicRequest;
}
impl<T: Into<Request>> DynamicRequestExt for T {
fn root_value(self, value: FieldValue<'static>) -> DynamicRequest {
DynamicRequest {
inner: self.into(),
root_value: value,
}
}
}
impl<T: Into<Request>> From<T> for DynamicRequest {
fn from(req: T) -> Self {
Self {
inner: req.into(),
root_value: FieldValue::NULL,
}
}
}