pub fn register_before_node_read(
        &mut self,
        type_names: Vec<String>,
        f: BeforeQueryEventFunc<RequestCtx>,
    ) {
        for type_name in type_names {
            if let Some(handlers) = self.before_read_handlers.get_mut(&type_name) {
                handlers.push(f);
            } else {
                self.before_read_handlers.insert(type_name, vec![f]);
            }
        }
    }
/// Registers an event handler `f` to be called before nodes of type `type_name` are read.
///
/// # Examples
///
/// ```rust
/// # use warpgrapher::engine::events::{EventHandlerBag, EventFacade};
/// # use warpgrapher::Error;
/// # use warpgrapher::engine::value::Value;
/// # use warpgrapher::juniper::BoxFuture;
///
/// fn before_user_read(value_opt: Option<Value>, ef: EventFacade<()>) -> BoxFuture<Result<Option<Value>, Error>> {
///    Box::pin(async move {
///       // Normally work would be done here, resulting in some new value.
///       Ok(value_opt)
///    })
/// }
///
/// let mut handlers = EventHandlerBag::<()>::new();
/// handlers.register_before_node_read(vec!["User".to_string()], before_user_read);
/// ```
Registers an event handler `f` to be called before nodes of type `type_name` are read.
Registers an event handler ` f ` to be called before nodes of type ` type_name ` are read .
pub fn register_before_node_read(
        &mut self,
        type_names: Vec<String>,
        f: BeforeQueryEventFunc<RequestCtx>,
    ) {
        for type_name in type_names {
            if let Some(handlers) = self.before_read_handlers.get_mut(&type_name) {
                handlers.push(f);
            } else {
                self.before_read_handlers.insert(type_name, vec![f]);
            }
        }
    }
pub fn register_before_node_read ( & mut self , type_names : Vec < String > , f : BeforeQueryEventFunc < RequestCtx > , ) { for type_name in type_names { if let Some ( handlers ) = self . before_read_handlers . get_mut ( & type_name ) { handlers . push ( f ) ; } else { self . before_read_handlers . insert ( type_name , vec ! [ f ] ) ; } } }
Registers an event handler `f` to be called before nodes of type `type_name` are read.
Registers an event handler ` f ` to be called before nodes of type ` type_name ` are read .
&mut self
type_names
Vec<String>
f
BeforeQueryEventFunc<RequestCtx>
&mut self
type_names
Vec<String>
f
BeforeQueryEventFunc<RequestCtx>
examples
None
use warpgrapher::engine::events::{eventhandlerbag, eventfacade};
None
use warpgrapher::error;
None
use warpgrapher::engine::value::value;
None
use warpgrapher::juniper::boxfuture;
fn before_user_read(value_opt: Option, ef: EventFacade<()>) -> BoxFuture, Error>> {
Box::pin(async move {
Normally work would be done here, resulting in some new value.

let mut handlers = EventHandlerBag::<()>::new();
handlers.register_before_node_read(vec!["User".to_string()], before_user_read);
```
fn before_user_read ( value_opt : Option ef : EventFacade< () > ) - > BoxFuture Error >> { Box :: pin ( async move { Normally work would be done here resulting in some new value . let mut handlers = EventHandlerBag :: < () > :: new () ; handlers . register_before_node_read ( vec! [ " User " . to_string () ] before_user_read ) ; ` ` `