diff --git a/integration_tests/juniper_tests/src/codegen/derive_enum.rs b/integration_tests/juniper_tests/src/codegen/derive_enum.rs index 27c5e8dd..85d893f2 100644 --- a/integration_tests/juniper_tests/src/codegen/derive_enum.rs +++ b/integration_tests/juniper_tests/src/codegen/derive_enum.rs @@ -42,7 +42,7 @@ enum OverrideDocEnum { #[test] fn test_derived_enum() { // Ensure that rename works. - assert_eq!(::name(&()), Some("Some")); + assert_eq!(>::name(&()), Some("Some")); // Ensure validity of meta info. let mut registry: juniper::Registry = juniper::Registry::new(FnvHashMap::default()); diff --git a/integration_tests/juniper_tests/src/codegen/derive_input_object.rs b/integration_tests/juniper_tests/src/codegen/derive_input_object.rs index 0c74d8fb..17a425c4 100644 --- a/integration_tests/juniper_tests/src/codegen/derive_input_object.rs +++ b/integration_tests/juniper_tests/src/codegen/derive_input_object.rs @@ -62,7 +62,7 @@ impl<'a> ToInputValue for &'a Fake { } } -impl<'a> GraphQLType for &'a Fake { +impl<'a> GraphQLType for &'a Fake { type Context = (); type TypeInfo = (); @@ -93,7 +93,7 @@ struct WithLifetime<'a> { #[test] fn test_derived_input_object() { - assert_eq!(::name(&()), Some("MyInput")); + assert_eq!(>::name(&()), Some("MyInput")); // Validate meta info. let mut registry: juniper::Registry = juniper::Registry::new(FnvHashMap::default()); diff --git a/integration_tests/juniper_tests/src/codegen/derive_object.rs b/integration_tests/juniper_tests/src/codegen/derive_object.rs index 23a2317c..a9cc839c 100644 --- a/integration_tests/juniper_tests/src/codegen/derive_object.rs +++ b/integration_tests/juniper_tests/src/codegen/derive_object.rs @@ -170,7 +170,7 @@ fn test_doc_comment_override() { #[test] fn test_derived_object() { - assert_eq!(::name(&()), Some("MyObj")); + assert_eq!(>::name(&()), Some("MyObj")); // Verify meta info. let mut registry: juniper::Registry = juniper::Registry::new(FnvHashMap::default()); diff --git a/integration_tests/juniper_tests/src/codegen/scalar_value_transparent.rs b/integration_tests/juniper_tests/src/codegen/scalar_value_transparent.rs index 886850cd..ecb2299d 100644 --- a/integration_tests/juniper_tests/src/codegen/scalar_value_transparent.rs +++ b/integration_tests/juniper_tests/src/codegen/scalar_value_transparent.rs @@ -31,7 +31,7 @@ impl User2 { #[test] fn test_scalar_value_simple() { - assert_eq!(::name(&()), Some("UserId")); + assert_eq!(>::name(&()), Some("UserId")); let mut registry: juniper::Registry = juniper::Registry::new(FnvHashMap::default()); let meta = UserId::meta(&(), &mut registry); @@ -49,7 +49,7 @@ fn test_scalar_value_simple() { #[test] fn test_scalar_value_custom() { - assert_eq!(::name(&()), Some("MyUserId")); + assert_eq!(>::name(&()), Some("MyUserId")); let mut registry: juniper::Registry = juniper::Registry::new(FnvHashMap::default()); let meta = CustomUserId::meta(&(), &mut registry); diff --git a/integration_tests/juniper_tests/src/custom_scalar.rs b/integration_tests/juniper_tests/src/custom_scalar.rs index f955d7bf..daf61bb4 100644 --- a/integration_tests/juniper_tests/src/custom_scalar.rs +++ b/integration_tests/juniper_tests/src/custom_scalar.rs @@ -37,6 +37,13 @@ impl ScalarValue for MyScalarValue { } } + fn as_str(&self) -> Option<&str> { + match *self { + MyScalarValue::String(ref s) => Some(s.as_str()), + _ => None, + } + } + fn as_float(&self) -> Option { match *self { MyScalarValue::Int(ref i) => Some(*i as f64), diff --git a/juniper/src/types/pointers.rs b/juniper/src/types/pointers.rs index ee82544c..3d3534fb 100644 --- a/juniper/src/types/pointers.rs +++ b/juniper/src/types/pointers.rs @@ -5,7 +5,7 @@ use crate::{ executor::{ExecutionResult, Executor, Registry}, schema::meta::MetaType, types::base::{Arguments, GraphQLType}, - value::{ScalarValue, Value}, + value::{ScalarValue}, }; impl GraphQLType for Box diff --git a/juniper_codegen/src/derive_scalar_value.rs b/juniper_codegen/src/derive_scalar_value.rs index 7805702f..754baadd 100644 --- a/juniper_codegen/src/derive_scalar_value.rs +++ b/juniper_codegen/src/derive_scalar_value.rs @@ -139,7 +139,7 @@ fn impl_scalar_struct( info: &(), selection: Option<&[#crate_name::Selection]>, executor: &#crate_name::Executor, - ) -> #crate_name::Value { + ) -> #crate_name::ExecutionResult { #crate_name::GraphQLType::resolve(&self.0, info, selection, executor) } }