Compare commits

..

No commits in common. "56688c9c09f8b8285fcaf17b7cabc7d4b1af88bb" and "2c4e66832fc16a927763046e6d73b036e82f57aa" have entirely different histories.

View file

@ -1,5 +1,3 @@
from os import getenv
from graphql import GraphQLError from graphql import GraphQLError
from graphql.language.ast import ( from graphql.language.ast import (
FieldNode, FieldNode,
@ -10,7 +8,7 @@ from graphql.language.ast import (
) )
from graphql.validation import ValidationRule from graphql.validation import ValidationRule
MAX_QUERY_DEPTH = getenv("GRAPHQL_MAX_QUERY_DEPTH", 13) MAX_QUERY_DEPTH = 8
def _max_field_depth(node, fragments, depth=0): def _max_field_depth(node, fragments, depth=0):
@ -38,7 +36,7 @@ def _selection_depth(node, fragments, depth):
class QueryDepthLimitRule(ValidationRule): class QueryDepthLimitRule(ValidationRule):
"""Prevents DoS via deeply nested GraphQL queries (max depth: 13).""" """Prevents DoS via deeply nested GraphQL queries (max depth: 8)."""
def enter_document(self, node, *_args): def enter_document(self, node, *_args):
fragments = { fragments = {