diff --git a/graphene/validation/disable_introspection.py b/graphene/validation/disable_introspection.py index 4c83050e..be25a287 100644 --- a/graphene/validation/disable_introspection.py +++ b/graphene/validation/disable_introspection.py @@ -8,12 +8,10 @@ from ..utils.is_introspection_key import is_introspection_key class DisableIntrospection(ValidationRule): def enter_field(self, node: FieldNode, *_args): field_name = node.name.value - if not is_introspection_key(field_name): - return - - self.report_error( - GraphQLError( - f"Cannot query '{field_name}': introspection is disabled.", - node, + if is_introspection_key(field_name): + self.report_error( + GraphQLError( + f"Cannot query '{field_name}': introspection is disabled.", + node, + ) ) - )