I have a before_node_update EventHandler that will return an error if certain conditions are met. In this case checking if a node with the same name exists already.
if name_exists.is_empty() {
return Ok(value);
}
else {
return Err((crate::Error::ProjectNameExists).into());
}
I'm using the warpgrapher client to test the feature, however the result coming back from the client in the error case the Result option is not the Error that I am returning, instead it is serde_json::Value::Null returned
In this test, the Project node with the name "Apollo" already exists, so I expect the result to be an Error.
let result = client
.update_node(
"Project",
"id",
None,
Some(&json!({
"name": {"EQ": "Achilles"},
})),
&json!({
"name": "Apollo",
})
).await;
println!("{:#?}", result);
---- test_update_project_duplicate_name stdout ----
Ok(
Null,
)
I have a before_node_update EventHandler that will return an error if certain conditions are met. In this case checking if a node with the same name exists already.
I'm using the warpgrapher client to test the feature, however the result coming back from the client in the error case the Result option is not the Error that I am returning, instead it is serde_json::Value::Null returned
In this test, the Project node with the name "Apollo" already exists, so I expect the result to be an Error.