Skip to content

Commit

Permalink
Add support for fourfold nested lists in introspection
Browse files Browse the repository at this point in the history
  • Loading branch information
Cito committed Sep 14, 2024
1 parent 7134b68 commit 2a3799f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
8 changes: 8 additions & 0 deletions src/graphql/utilities/get_introspection_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,14 @@ def input_deprecation(string: str) -> str | None:
ofType {{
kind
name
ofType {{
kind
name
ofType {{
kind
name
}}
}}
}}
}}
}}
Expand Down
14 changes: 7 additions & 7 deletions tests/utilities/test_build_client_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -991,11 +991,11 @@ def throws_when_missing_directive_args():
build_client_schema(introspection)

def describe_very_deep_decorators_are_not_supported():
def fails_on_very_deep_lists_more_than_7_levels():
def fails_on_very_deep_lists_more_than_8_levels():
schema = build_schema(
"""
type Query {
foo: [[[[[[[[String]]]]]]]]
foo: [[[[[[[[[[String]]]]]]]]]]
}
"""
)
Expand All @@ -1010,11 +1010,11 @@ def fails_on_very_deep_lists_more_than_7_levels():
" Decorated type deeper than introspection query."
)

def fails_on_a_very_deep_non_null_more_than_7_levels():
def fails_on_a_very_deep_more_than_8_levels_non_null():
schema = build_schema(
"""
type Query {
foo: [[[[String!]!]!]!]
foo: [[[[[String!]!]!]!]!]
}
"""
)
Expand All @@ -1029,12 +1029,12 @@ def fails_on_a_very_deep_non_null_more_than_7_levels():
" Decorated type deeper than introspection query."
)

def succeeds_on_deep_types_less_or_equal_7_levels():
# e.g., fully non-null 3D matrix
def succeeds_on_deep_less_or_equal_8_levels_types():
# e.g., fully non-null 4D matrix
sdl = dedent(
"""
type Query {
foo: [[[String!]!]!]!
foo: [[[[String!]!]!]!]!
}
"""
)
Expand Down

0 comments on commit 2a3799f

Please sign in to comment.