Skip to content

Commit 3d8d36a

Browse files
committed
Support fourfold nested lists
Replicates graphql/graphql-js@bec1b49
1 parent 91fbe86 commit 3d8d36a

File tree

2 files changed

+19
-12
lines changed

2 files changed

+19
-12
lines changed

src/graphql/utilities/get_introspection_query.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
from ..language import DirectiveLocation
55

66
try:
7-
from typing import TypedDict, Literal
7+
from typing import Literal, TypedDict
88
except ImportError: # Python < 3.8
9-
from typing_extensions import TypedDict, Literal # type: ignore
9+
from typing_extensions import Literal, TypedDict # type: ignore
1010

1111
__all__ = [
1212
"get_introspection_query",
@@ -139,6 +139,14 @@ def input_deprecation(string: str) -> Optional[str]:
139139
ofType {{
140140
kind
141141
name
142+
ofType {{
143+
kind
144+
name
145+
ofType {{
146+
kind
147+
name
148+
}}
149+
}}
142150
}}
143151
}}
144152
}}

tests/utilities/test_build_client_schema.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
from typing import cast
22

3-
from pytest import raises
4-
53
from graphql import graphql_sync
64
from graphql.type import (
75
GraphQLArgument,
@@ -18,8 +16,8 @@
1816
assert_enum_type,
1917
)
2018
from graphql.utilities import (
21-
build_schema,
2219
build_client_schema,
20+
build_schema,
2321
introspection_from_schema,
2422
print_schema,
2523
)
@@ -31,6 +29,7 @@
3129
IntrospectionType,
3230
IntrospectionUnionType,
3331
)
32+
from pytest import raises
3433

3534
from ..utils import dedent
3635

@@ -991,11 +990,11 @@ def throws_when_missing_directive_args():
991990
build_client_schema(introspection)
992991

993992
def describe_very_deep_decorators_are_not_supported():
994-
def fails_on_very_deep_lists_more_than_7_levels():
993+
def fails_on_very_deep_lists_more_than_8_levels():
995994
schema = build_schema(
996995
"""
997996
type Query {
998-
foo: [[[[[[[[String]]]]]]]]
997+
foo: [[[[[[[[[[String]]]]]]]]]]
999998
}
1000999
"""
10011000
)
@@ -1010,11 +1009,11 @@ def fails_on_very_deep_lists_more_than_7_levels():
10101009
" Decorated type deeper than introspection query."
10111010
)
10121011

1013-
def fails_on_a_very_deep_non_null_more_than_7_levels():
1012+
def fails_on_a_very_deep_non_null_more_than_8_levels():
10141013
schema = build_schema(
10151014
"""
10161015
type Query {
1017-
foo: [[[[String!]!]!]!]
1016+
foo: [[[[[String!]!]!]!]!]
10181017
}
10191018
"""
10201019
)
@@ -1029,12 +1028,12 @@ def fails_on_a_very_deep_non_null_more_than_7_levels():
10291028
" Decorated type deeper than introspection query."
10301029
)
10311030

1032-
def succeeds_on_deep_types_less_or_equal_7_levels():
1033-
# e.g., fully non-null 3D matrix
1031+
def succeeds_on_deep_types_less_or_equal_8_levels():
1032+
# e.g., fully non-null 4D matrix
10341033
sdl = dedent(
10351034
"""
10361035
type Query {
1037-
foo: [[[String!]!]!]!
1036+
foo: [[[[String!]!]!]!]!
10381037
}
10391038
"""
10401039
)

0 commit comments

Comments
 (0)