Update depth_limit.py

This commit is contained in:
Aryan Iyappan 2021-08-20 20:56:19 +05:30 committed by GitHub
parent ea4e6d65e9
commit 57a4394bf3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -25,7 +25,12 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE. # SOFTWARE.
import re try:
from re import Pattern
except ImportError:
# backwards compatibility for v3.6
from typing import Pattern
from typing import Callable, Dict, List, Optional, Union from typing import Callable, Dict, List, Optional, Union
from graphql import GraphQLError from graphql import GraphQLError
@ -43,7 +48,7 @@ from graphql.language import (
from ..utils.is_introspection_key import is_introspection_key from ..utils.is_introspection_key import is_introspection_key
IgnoreType = Union[Callable[[str], bool], re.Pattern, str] IgnoreType = Union[Callable[[str], bool], Pattern, str]
def depth_limit_validator( def depth_limit_validator(