This repository was archived by the owner on Jun 13, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +16
-12
lines changed Expand file tree Collapse file tree 1 file changed +16
-12
lines changed Original file line number Diff line number Diff line change 1212 create_max_depth_rule ,
1313)
1414
15+
16+ def resolve_field (* args ):
17+ return "test"
18+
19+
1520QueryType = GraphQLObjectType (
16- "Query" , {"field" : GraphQLField (GraphQLString , resolve = lambda * args : "test" )}
21+ "Query" , {"field" : GraphQLField (GraphQLString , resolve = resolve_field )}
1722)
1823schema = GraphQLSchema (query = QueryType )
1924
@@ -50,7 +55,16 @@ def test_max_depth_rule_rejects_exceeding_depth():
5055 )
5156
5257
53- # Tests for MaxAliasesRule
58+ def test_max_depth_rule_exact_depth ():
59+ query = """
60+ query {
61+ field
62+ }
63+ """
64+ errors = validate_query (query , create_max_depth_rule (2 ))
65+ assert not errors , "Expected no errors when query depth matches the limit"
66+
67+
5468def test_max_aliases_rule_allows_within_alias_limit ():
5569 query = """
5670 query {
@@ -75,16 +89,6 @@ def test_max_aliases_rule_rejects_exceeding_alias_limit():
7589 assert any ("Query uses too many aliases" in str (e ) for e in errors )
7690
7791
78- def test_max_depth_rule_exact_depth ():
79- query = """
80- query {
81- field
82- }
83- """
84- errors = validate_query (query , create_max_depth_rule (2 ))
85- assert not errors , "Expected no errors when query depth matches the limit"
86-
87-
8892def test_max_aliases_rule_exact_alias_limit ():
8993 query = """
9094 query {
You can’t perform that action at this time.
0 commit comments