pub fn create_rel_with_dst_node(
        &self,
        id: Value,
        props: Option<HashMap<String, Value>>,
        dst: Node<RequestCtx>,
    ) -> Result<Rel<RequestCtx>, Error> {
        if let Object::Node(parent_node) = self.parent {
            Ok(Rel::new(
                id,
                self.partition_key_opt.cloned(),
                props.map(|p| Node::new("props".to_string(), p)),
                NodeRef::Identifier {
                    id: parent_node.id()?.clone(),
                    label: parent_node.type_name().to_string(),
                },
                NodeRef::Node(dst),
            ))
        } else {
            Err(Error::TypeNotExpected { details: None })
        }
    }
/// Creates a [`Rel`], with a id, properties, and destination node. The src node of the
/// relationship is the parent node on which the field is being resolved.
///
/// # Error
///
/// Returns an [`Error`] of variant [`TypeNotExpected`] if the parent object isn't a node
///
/// [`Error`]: ../../error/enum.Error.html
/// [`TypeNotExpected`]: ../../error/enum.Error.html#variant.TypeNotExpected
///
/// # Examples
///
/// ```rust,no_run
/// # use std::collections::HashMap;
/// # use warpgrapher::engine::resolvers::{ResolverFacade, ExecutionResult};
/// # use warpgrapher::engine::value::Value;
/// # use warpgrapher::juniper::BoxFuture;
///
/// fn custom_resolve(facade: ResolverFacade<()>) -> BoxFuture<ExecutionResult> {
///     Box::pin(async move {
///         let node_id = Value::String("12345678-1234-1234-1234-1234567890ab".to_string());
///         let typename = "User";
///         let mut props = HashMap::new();
///         props.insert("role".to_string(), Value::String("Admin".to_string()));
///         let n = facade.node(typename, props);
///
///         let rel_id = Value::String("1e2ac081-b0a6-4f68-bc88-99bdc4111f00".to_string());
///         let mut rel_props = HashMap::new();
///         rel_props.insert("since".to_string(), Value::String("2020-01-01".to_string()));
///
///         let rel = facade.create_rel_with_dst_node(rel_id, Some(rel_props), n)?;
///         facade.resolve_rel(&rel).await
///     })
/// }
/// ```
Creates a [`Rel`], with a id, properties, and destination node. The src node of the
relationship is the parent node on which the field is being resolved.
Creates a [ ` Rel ` ] with a id properties and destination node . The src node of the relationship is the parent node on which the field is being resolved .
pub fn create_rel_with_dst_node(
        &self,
        id: Value,
        props: Option<HashMap<String, Value>>,
        dst: Node<RequestCtx>,
    ) -> Result<Rel<RequestCtx>, Error> {
        if let Object::Node(parent_node) = self.parent {
            Ok(Rel::new(
                id,
                self.partition_key_opt.cloned(),
                props.map(|p| Node::new("props".to_string(), p)),
                NodeRef::Identifier {
                    id: parent_node.id()?.clone(),
                    label: parent_node.type_name().to_string(),
                },
                NodeRef::Node(dst),
            ))
        } else {
            Err(Error::TypeNotExpected { details: None })
        }
    }
pub fn create_rel_with_dst_node ( & self , id : Value , props : Option < HashMap < String , Value > > , dst : Node < RequestCtx > , ) -> Result < Rel < RequestCtx > , Error > { if let Object :: Node ( parent_node ) = self . parent { Ok ( Rel :: new ( id , self . partition_key_opt . cloned ( ) , props . map ( | p | Node :: new ( " " . to_string ( ) , p ) ) , NodeRef :: Identifier { id : parent_node . id ( ) ? . clone ( ) , label : parent_node . type_name ( ) . to_string ( ) , } , NodeRef :: Node ( dst ) , ) ) } else { Err ( Error :: TypeNotExpected { details : None } ) } }
Creates a [`Rel`], with a id, properties, and destination node.
Creates a [ ` Rel ` ] with a id properties and destination node .
&self
id
Value
props
Option<HashMap<String, Value>>
dst
Node<RequestCtx>
&self
id
Value
props
Option<HashMap<String, Value>>
dst
Node<RequestCtx>
error
Returns an [`Error`] of variant [`TypeNotExpected`] if the parent object isn't a node

[`Error`]: ../../error/enum.Error.html
[`TypeNotExpected`]: ../../error/enum.Error.html#variant.TypeNotExpected
Returns an [ ` Error ` ] of variant [ ` TypeNotExpected ` ] if the parent object isn ' t a node [ ` Error ` ] : .. / .. / error / enum . Error . html [ ` TypeNotExpected ` ] : .. / .. / error / enum . Error . html#variant . TypeNotExpected
examples
None
use std::collections::hashmap;
None
use warpgrapher::engine::resolvers::{resolverfacade, executionresult};
None
use warpgrapher::engine::value::value;
None
use warpgrapher::juniper::boxfuture;
fn custom_resolve(facade: ResolverFacade<()>) -> BoxFuture {
Box::pin(async move {
let node_id = Value::String("12345678-1234-1234-1234-1234567890ab".to_string());
let typename = "User";
let mut props = HashMap::new();
props.insert("role".to_string(), Value::String("Admin".to_string()));
let n = facade.node(typename, props).



let rel = facade.create_rel_with_dst_node(rel_id, Some(rel_props), n)?;
facade.resolve_rel(&rel).await
})
}
```
fn custom_resolve ( facade : ResolverFacade< () > ) - > BoxFuture { Box :: pin ( async move { let node_id = Value :: String ( " 12345678 - 1234 - 1234 - 1234 - 1234567890ab " . to_string () ) ; let typename = " User " ; let mut props = HashMap :: new () ; props . insert ( " role " . to_string () Value :: String ( " Admin " . to_string () )) ; let n = facade . node ( typename props ) . let rel = facade . create_rel_with_dst_node ( rel_id Some ( rel_props ) n ) ? ; facade . resolve_rel ( &rel ) . await } ) } ` ` `