Update visitor.rs

This commit is contained in:
sunli 2020-03-10 15:17:01 +08:00
parent 1987a7402b
commit d8c0018856

View File

@ -376,6 +376,15 @@ fn visit_selection<'a, V: Visitor<'a>>(
visit_field(v, ctx, field); visit_field(v, ctx, field);
}, },
); );
} else {
ctx.report_error(
vec![field.position],
format!(
"Cannot query field \"{}\" on type \"{}\".",
field.name,
ctx.current_type().name()
),
);
} }
} }
Selection::FragmentSpread(fragment_spread) => { Selection::FragmentSpread(fragment_spread) => {