diff --git a/juniper/src/macros/interface.rs b/juniper/src/macros/interface.rs index 6c23336b..a5459398 100644 --- a/juniper/src/macros/interface.rs +++ b/juniper/src/macros/interface.rs @@ -281,7 +281,7 @@ macro_rules! graphql_interface { $($items)*); } - fn concrete_type_name(&$mainself, context: &Self::Context) -> String { + fn concrete_type_name(&$mainself, context: &Self::Context, _info: &()) -> String { graphql_interface!( @ concrete_type_name, ($outname, context, $ctxt), diff --git a/juniper/src/macros/object.rs b/juniper/src/macros/object.rs index f59ff90d..1faf0ead 100644 --- a/juniper/src/macros/object.rs +++ b/juniper/src/macros/object.rs @@ -406,7 +406,7 @@ macro_rules! graphql_object { mt.into_meta() } - fn concrete_type_name(&self, _: &Self::Context) -> String { + fn concrete_type_name(&self, _: &Self::Context, _: &()) -> String { $outname.to_owned() } diff --git a/juniper/src/macros/union.rs b/juniper/src/macros/union.rs index df0b3aad..5a480d69 100644 --- a/juniper/src/macros/union.rs +++ b/juniper/src/macros/union.rs @@ -131,7 +131,7 @@ macro_rules! graphql_union { mt.into_meta() } - fn concrete_type_name(&$mainself, context: &Self::Context) -> String { + fn concrete_type_name(&$mainself, context: &Self::Context, _: &()) -> String { graphql_union!( @ concrete_type_name, ($outname, context, $ctxt), diff --git a/juniper/src/types/base.rs b/juniper/src/types/base.rs index 09e0e57f..5fbe7144 100644 --- a/juniper/src/types/base.rs +++ b/juniper/src/types/base.rs @@ -289,7 +289,7 @@ pub trait GraphQLType: Sized { /// /// The default implementation panics. #[allow(unused_variables)] - fn concrete_type_name(&self, context: &Self::Context) -> String { + fn concrete_type_name(&self, context: &Self::Context, info: &Self::TypeInfo) -> String { panic!("concrete_type_name must be implemented by unions and interfaces"); } @@ -357,7 +357,7 @@ where if f.name.item == "__typename" { result.insert( (*response_name).to_owned(), - Value::string(instance.concrete_type_name(executor.context())), + Value::string(instance.concrete_type_name(executor.context(), info)), ); continue; } diff --git a/juniper_codegen/src/derive_object.rs b/juniper_codegen/src/derive_object.rs index dacc90ec..e777d071 100644 --- a/juniper_codegen/src/derive_object.rs +++ b/juniper_codegen/src/derive_object.rs @@ -150,7 +150,7 @@ pub fn impl_object(ast: &syn::DeriveInput) -> Tokens { Some(#name) } - fn concrete_type_name(&self, _: &Self::Context) -> String { + fn concrete_type_name(&self, _: &Self::Context, _: &()) -> String { #name.to_string() }