diff --git a/src/blueprint/blueprint.rs b/src/blueprint/blueprint.rs index 676838411c..5cd109d411 100644 --- a/src/blueprint/blueprint.rs +++ b/src/blueprint/blueprint.rs @@ -53,14 +53,6 @@ impl Type { Type::ListType { non_null, .. } => *non_null, } } - - /// checks if the type is a list - pub fn is_list(&self) -> bool { - match self { - Type::NamedType { .. } => false, - Type::ListType { .. } => true, - } - } } #[derive(Clone, Debug)] diff --git a/src/blueprint/into_schema.rs b/src/blueprint/into_schema.rs index 0829f79c18..9b886bb848 100644 --- a/src/blueprint/into_schema.rs +++ b/src/blueprint/into_schema.rs @@ -41,7 +41,6 @@ fn to_type(def: &Definition) -> dynamic::Type { let field = field.clone(); let type_ref = to_type_ref(&field.of_type); let field_name = &field.name.clone(); - let is_list = field.of_type.is_list(); let mut dyn_schema_field = dynamic::Field::new( field_name, type_ref.clone(), @@ -73,13 +72,8 @@ fn to_type(def: &Definition) -> dynamic::Type { expr.eval(ctx, &Concurrent::Sequential).await?; let p = match const_value { ConstValue::List(a) => Some(FieldValue::list(a)), - a => { - if a == ConstValue::Null && is_list { - FieldValue::NONE - } else { - Some(FieldValue::from(a)) - } - } + ConstValue::Null => FieldValue::NONE, + a => Some(FieldValue::from(a)), }; Ok(p) } diff --git a/tests/snapshots/execution_spec__graphql-datasource-errors.md_test_0.snap b/tests/snapshots/execution_spec__graphql-datasource-errors.md_test_0.snap index 5e4910e7ab..e68bb4b23a 100644 --- a/tests/snapshots/execution_spec__graphql-datasource-errors.md_test_0.snap +++ b/tests/snapshots/execution_spec__graphql-datasource-errors.md_test_0.snap @@ -9,9 +9,7 @@ expression: response }, "body": { "data": { - "user": { - "name": null - } + "user": null }, "errors": [ { diff --git a/tests/snapshots/execution_spec__test-null-in-object.md_test_0.snap b/tests/snapshots/execution_spec__test-null-in-object.md_test_0.snap index e2041de63e..611acae330 100644 --- a/tests/snapshots/execution_spec__test-null-in-object.md_test_0.snap +++ b/tests/snapshots/execution_spec__test-null-in-object.md_test_0.snap @@ -9,10 +9,7 @@ expression: response }, "body": { "data": { - "hi": { - "name": null, - "id": null - } + "hi": null } } }