Remove compiler assertion that fails in WWW
@@ -389,18 +389,8 @@ impl<'program> RelayResolverFieldTransform<'program> {
directive.name.location,
));
}
- let parent_type = field_type.parent_type.unwrap();
if let Some(fragment_name) = fragment_name {
- match self.program.fragment(fragment_name) {
- Some(fragment_definition) => {
- if fragment_definition.type_condition != parent_type {
- // This invariant is enforced when we generate docblock IR, but we double check here to
- // ensure no later transforms break that invariant, and that manually written test
- // schemas gets this right.
- panic!("Expected resolver fragment type condition to match parent selection.")
- }
- },
- None => {
+ if self.program.fragment(fragment_name).is_none() {
self.errors.push(Diagnostic::error(
ValidationMessage::InvalidRelayResolverFragmentName {
fragment_name,
@@ -412,7 +402,7 @@ impl<'program> RelayResolverFieldTransform<'program> {
return None;
}
}
- }
+ let parent_type = field_type.parent_type.unwrap();
let output_type_info = if has_output_type {
if field_type.type_.inner().is_composite_type() {
