Fixes #946
This commit is contained in:
parent
227a63d0ad
commit
933a818afb
|
@ -606,20 +606,7 @@ impl Registry {
|
||||||
})
|
})
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
if !possible_types.is_empty() {
|
if let MetaType::Object { fields, .. } = self.types.get_mut(&self.query_type).unwrap() {
|
||||||
self.types.insert(
|
|
||||||
"_Entity".to_string(),
|
|
||||||
MetaType::Union {
|
|
||||||
name: "_Entity".to_string(),
|
|
||||||
description: None,
|
|
||||||
possible_types,
|
|
||||||
visible: None,
|
|
||||||
rust_typename: "async_graphql::federation::Entity",
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
let query_root = self.types.get_mut(&self.query_type).unwrap();
|
|
||||||
if let MetaType::Object { fields, .. } = query_root {
|
|
||||||
fields.insert(
|
fields.insert(
|
||||||
"_service".to_string(),
|
"_service".to_string(),
|
||||||
MetaField {
|
MetaField {
|
||||||
|
@ -636,7 +623,21 @@ impl Registry {
|
||||||
compute_complexity: None,
|
compute_complexity: None,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if !possible_types.is_empty() {
|
||||||
|
self.types.insert(
|
||||||
|
"_Entity".to_string(),
|
||||||
|
MetaType::Union {
|
||||||
|
name: "_Entity".to_string(),
|
||||||
|
description: None,
|
||||||
|
possible_types,
|
||||||
|
visible: None,
|
||||||
|
rust_typename: "async_graphql::federation::Entity",
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
if let MetaType::Object { fields, .. } = self.types.get_mut(&self.query_type).unwrap() {
|
||||||
fields.insert(
|
fields.insert(
|
||||||
"_entities".to_string(),
|
"_entities".to_string(),
|
||||||
MetaField {
|
MetaField {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user