2222Here is how you would implement depth-limiting on your schema.
2323
2424.. code :: python
25+
2526 from graphql import validate, parse
2627 from graphene import ObjectType, Schema, String
2728 from graphene.validation import depth_limit_validator
@@ -37,7 +38,7 @@ Here is how you would implement depth-limiting on your schema.
3738 # will not be executed.
3839
3940 validation_errors = validate(
40- schema = schema,
41+ schema = schema.graphql_schema ,
4142 document_ast = parse(' THE QUERY' ),
4243 rules = (
4344 depth_limit_validator(
5859Here is how you would disable introspection for your schema.
5960
6061.. code :: python
62+
6163 from graphql import validate, parse
6264 from graphene import ObjectType, Schema, String
6365 from graphene.validation import DisableIntrospection
@@ -72,7 +74,7 @@ Here is how you would disable introspection for your schema.
7274 # introspection queries will not be executed.
7375
7476 validation_errors = validate(
75- schema = schema,
77+ schema = schema.graphql_schema ,
7678 document_ast = parse(' THE QUERY' ),
7779 rules = (
7880 DisableIntrospection,
@@ -92,6 +94,7 @@ reason. Here is an example query validator that visits field definitions in Grap
9294if any of those fields are blacklisted:
9395
9496.. code :: python
97+
9598 from graphql import GraphQLError
9699 from graphql.language import FieldNode
97100 from graphql.validation import ValidationRule
0 commit comments