add failing test for list of non-null items for issue #84
This commit is contained in:
parent
bee88d4265
commit
8cf2707faa
1 changed files with 27 additions and 0 deletions
|
@ -451,6 +451,7 @@ mod propagates_errors_to_nullable_fields {
|
||||||
|
|
||||||
graphql_object!(Schema: () |&self| {
|
graphql_object!(Schema: () |&self| {
|
||||||
field inner() -> Inner { Inner }
|
field inner() -> Inner { Inner }
|
||||||
|
field inners() -> Vec<Inner> { (0..5).map(|_| Inner).collect() }
|
||||||
});
|
});
|
||||||
|
|
||||||
graphql_object!(Inner: () |&self| {
|
graphql_object!(Inner: () |&self| {
|
||||||
|
@ -589,6 +590,32 @@ mod propagates_errors_to_nullable_fields {
|
||||||
),
|
),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn non_null_list() {
|
||||||
|
let schema = RootNode::new(Schema, EmptyMutation::<()>::new());
|
||||||
|
let doc = r"{ inners { nonNullableErrorField } }";
|
||||||
|
|
||||||
|
let vars = vec![].into_iter().collect();
|
||||||
|
|
||||||
|
let (result, errs) = ::execute(doc, None, &schema, &vars, &()).expect("Execution failed");
|
||||||
|
|
||||||
|
println!("Result: {:?}", result);
|
||||||
|
|
||||||
|
assert_eq!(
|
||||||
|
result,
|
||||||
|
graphql_value!(None));
|
||||||
|
|
||||||
|
assert_eq!(
|
||||||
|
errs,
|
||||||
|
vec![
|
||||||
|
ExecutionError::new(
|
||||||
|
SourcePosition::new(10, 0, 10),
|
||||||
|
&["inner", "nonNullableErrorField"],
|
||||||
|
FieldError::new("Error for nonNullableErrorField", Value::null()),
|
||||||
|
),
|
||||||
|
]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mod named_operations {
|
mod named_operations {
|
||||||
|
|
Loading…
Reference in a new issue