Update queryvalidation.rst

This commit is contained in:
Aryan Iyappan 2021-09-28 06:41:54 +05:30 committed by GitHub
parent efc03533ae
commit c1bd25555c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -22,6 +22,7 @@ Usage
Here is how you would implement depth-limiting on your schema. Here is how you would implement depth-limiting on your schema.
.. code:: python .. code:: python
from graphql import validate, parse from graphql import validate, parse
from graphene import ObjectType, Schema, String from graphene import ObjectType, Schema, String
from graphene.validation import depth_limit_validator from graphene.validation import depth_limit_validator
@ -58,6 +59,7 @@ Usage
Here is how you would disable introspection for your schema. Here is how you would disable introspection for your schema.
.. code:: python .. code:: python
from graphql import validate, parse from graphql import validate, parse
from graphene import ObjectType, Schema, String from graphene import ObjectType, Schema, String
from graphene.validation import DisableIntrospection from graphene.validation import DisableIntrospection
@ -92,6 +94,7 @@ reason. Here is an example query validator that visits field definitions in Grap
if any of those fields are blacklisted: if any of those fields are blacklisted:
.. code:: python .. code:: python
from graphql import GraphQLError from graphql import GraphQLError
from graphql.language import FieldNode from graphql.language import FieldNode
from graphql.validation import ValidationRule from graphql.validation import ValidationRule