From 7d890bf91521a3e7905e95f442a4e934a68603fb Mon Sep 17 00:00:00 2001 From: Syrus Akbary Date: Thu, 19 Aug 2021 14:02:45 -0500 Subject: [PATCH] Update graphene/validation/disable_introspection.py --- graphene/validation/disable_introspection.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) 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, + ) ) - )