From 2a3799fec77d5e71d7ebe61d0e257a13cc3b2f4b Mon Sep 17 00:00:00 2001 From: Christoph Zwerschke Date: Sat, 14 Sep 2024 21:32:28 +0200 Subject: [PATCH] Add support for fourfold nested lists in introspection Replicates graphql/graphql-js@826ae7f952dcccd8bb8a7ade3d9f9c7540edcc06 --- src/graphql/utilities/get_introspection_query.py | 8 ++++++++ tests/utilities/test_build_client_schema.py | 14 +++++++------- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/graphql/utilities/get_introspection_query.py b/src/graphql/utilities/get_introspection_query.py index cffaa12d..4babfaec 100644 --- a/src/graphql/utilities/get_introspection_query.py +++ b/src/graphql/utilities/get_introspection_query.py @@ -149,6 +149,14 @@ def input_deprecation(string: str) -> str | None: ofType {{ kind name + ofType {{ + kind + name + ofType {{ + kind + name + }} + }} }} }} }} diff --git a/tests/utilities/test_build_client_schema.py b/tests/utilities/test_build_client_schema.py index 4b861003..8a4cecba 100644 --- a/tests/utilities/test_build_client_schema.py +++ b/tests/utilities/test_build_client_schema.py @@ -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]]]]]]]]]] } """ ) @@ -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!]!]!]!]!] } """ ) @@ -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!]!]!]!]! } """ )