Merge remote-tracking branch 'upstream/async-await' into async-await
This commit is contained in:
commit
563e44c2ac
1 changed files with 13 additions and 6 deletions
|
@ -41,11 +41,18 @@ pub fn build_object(args: TokenStream, body: TokenStream, is_internal: bool) ->
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let name = if let Some(ident) = util::name_of_type(&*_impl.self_ty) {
|
|
||||||
ident
|
let name =
|
||||||
} else {
|
if let Some(name) = impl_attrs.name.as_ref(){
|
||||||
panic!("Could not determine a name for the object type: specify one with #[juniper::object(name = \"SomeName\")");
|
name.to_string()
|
||||||
};
|
}
|
||||||
|
else {
|
||||||
|
if let Some(ident) = util::name_of_type(&*_impl.self_ty) {
|
||||||
|
ident.to_string()
|
||||||
|
} else {
|
||||||
|
panic!("Could not determine a name for the object type: specify one with #[juniper::object(name = \"SomeName\")");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
let target_type = *_impl.self_ty.clone();
|
let target_type = *_impl.self_ty.clone();
|
||||||
|
|
||||||
|
@ -54,7 +61,7 @@ pub fn build_object(args: TokenStream, body: TokenStream, is_internal: bool) ->
|
||||||
.or(util::get_doc_comment(&_impl.attrs));
|
.or(util::get_doc_comment(&_impl.attrs));
|
||||||
|
|
||||||
let mut definition = util::GraphQLTypeDefiniton {
|
let mut definition = util::GraphQLTypeDefiniton {
|
||||||
name: name.to_string(),
|
name: name,
|
||||||
_type: target_type.clone(),
|
_type: target_type.clone(),
|
||||||
context: impl_attrs.context,
|
context: impl_attrs.context,
|
||||||
scalar: impl_attrs.scalar,
|
scalar: impl_attrs.scalar,
|
||||||
|
|
Loading…
Add table
Reference in a new issue