Skip to content

Client not returning event error #140

Description

@taylorcenters

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,
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions