From 3cb5a5529cc8a37cab657b057b96271be643425d Mon Sep 17 00:00:00 2001 From: Leszek Hanusz Date: Mon, 27 Jan 2025 02:37:36 +0100 Subject: [PATCH 1/2] Fix test for introspection type recursion level change in graphql-core v3.3.0a7 --- tests/starwars/test_dsl.py | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/tests/starwars/test_dsl.py b/tests/starwars/test_dsl.py index 2aadf92f..b446ae8a 100644 --- a/tests/starwars/test_dsl.py +++ b/tests/starwars/test_dsl.py @@ -992,10 +992,25 @@ def test_get_introspection_query_ast(option): schema_description=option, ) - assert print_ast(gql(introspection_query)) == print_ast(dsl_introspection_query) - assert node_tree(dsl_introspection_query) == node_tree( - gql(print_ast(dsl_introspection_query)) - ) + try: + assert print_ast(gql(introspection_query)) == print_ast(dsl_introspection_query) + assert node_tree(dsl_introspection_query) == node_tree( + gql(print_ast(dsl_introspection_query)) + ) + except AssertionError: + + # From graphql-core version 3.3.0a7, there is two more type recursion levels + dsl_introspection_query = get_introspection_query_ast( + descriptions=option, + specified_by_url=option, + directive_is_repeatable=option, + schema_description=option, + type_recursion_level=9, + ) + assert print_ast(gql(introspection_query)) == print_ast(dsl_introspection_query) + assert node_tree(dsl_introspection_query) == node_tree( + gql(print_ast(dsl_introspection_query)) + ) def test_typename_aliased(ds): From 7b331d88e2f1b56fbdcbc99b8a17345c0d9db93e Mon Sep 17 00:00:00 2001 From: Leszek Hanusz Date: Mon, 27 Jan 2025 18:44:09 +0100 Subject: [PATCH 2/2] Adding input_value_deprecation arg --- tests/starwars/test_dsl.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/starwars/test_dsl.py b/tests/starwars/test_dsl.py index fcb4b95b..5cd051ba 100644 --- a/tests/starwars/test_dsl.py +++ b/tests/starwars/test_dsl.py @@ -1007,6 +1007,7 @@ def test_get_introspection_query_ast(option): specified_by_url=option, directive_is_repeatable=option, schema_description=option, + input_value_deprecation=option, type_recursion_level=9, ) assert print_ast(gql(introspection_query)) == print_ast(dsl_introspection_query)