mirror of
https://github.com/graphql-python/graphene.git
synced 2024-11-29 13:03:56 +03:00
Update graphene/validation/disable_introspection.py
This commit is contained in:
parent
0e4c14b076
commit
7d890bf915
|
@ -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,
|
||||
)
|
||||
)
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue
Block a user