Skip to content

Some tests are failing with graphql-core v3.3.0a7 #522

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
leszekhanusz opened this issue Jan 27, 2025 · 1 comment
Closed

Some tests are failing with graphql-core v3.3.0a7 #522

leszekhanusz opened this issue Jan 27, 2025 · 1 comment
Labels
type: bug An issue or pull request relating to a bug

Comments

@leszekhanusz
Copy link
Collaborator

leszekhanusz commented Jan 27, 2025

The tests are now failing with graphql-core 3.3.0a7 for multiple reasons:

======================================================================================= short test summary info =======================================================================================
FAILED tests/test_transport.py::test_hero_name_query - requests.exceptions.ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=8000): Max retries exceeded with url: /graphql (Caused by NewConnectionError('<urllib3.connection.HTTPConnection ob...
FAILED tests/test_transport.py::test_query_with_variable - requests.exceptions.ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=8000): Max retries exceeded with url: /graphql (Caused by NewConnectionError('<urllib3.connection.HTTPConnection ob...
FAILED tests/test_transport.py::test_named_query - requests.exceptions.ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=8000): Max retries exceeded with url: /graphql (Caused by NewConnectionError('<urllib3.connection.HTTPConnection ob...
FAILED tests/test_transport.py::test_header_query - requests.exceptions.ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=8000): Max retries exceeded with url: /graphql (Caused by NewConnectionError('<urllib3.connection.HTTPConnection ob...
FAILED tests/test_transport_batch.py::test_hero_name_query - requests.exceptions.ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=8000): Max retries exceeded with url: /graphql (Caused by NewConnectionError('<urllib3.connection.HTTPConnection ob...
FAILED tests/test_transport_batch.py::test_query_with_variable - requests.exceptions.ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=8000): Max retries exceeded with url: /graphql (Caused by NewConnectionError('<urllib3.connection.HTTPConnection ob...
FAILED tests/test_transport_batch.py::test_named_query - requests.exceptions.ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=8000): Max retries exceeded with url: /graphql (Caused by NewConnectionError('<urllib3.connection.HTTPConnection ob...
FAILED tests/test_transport_batch.py::test_header_query - requests.exceptions.ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=8000): Max retries exceeded with url: /graphql (Caused by NewConnectionError('<urllib3.connection.HTTPConnection ob...
FAILED tests/starwars/test_dsl.py::test_get_introspection_query_ast[True] - AssertionError: assert 'query IntrospectionQuery {\n  __schema {\n    description\n    queryType {\n      name\n    }\n    mutationType {\n      name\n    }\n    subscriptionType {\n      name\n...
FAILED tests/starwars/test_dsl.py::test_get_introspection_query_ast[False] - AssertionError: assert 'query IntrospectionQuery {\n  __schema {\n    queryType {\n      name\n    }\n    mutationType {\n      name\n    }\n    subscriptionType {\n      name\n    }\n    types ...
FAILED tests/starwars/test_dsl.py::test_node_tree_with_loc - assert "DocumentNode\n  loc:\n    Location\n      <Location 0:43>\n  definitions:\n    OperationDefinitionNode\n      loc:\n        Location\n          <Location 0:43>\n      directives:\n      ...

Problem 1 - introspection query changed

From graphql-core v3.3.0a7, the default introspection query has now two more recursion levels.
A fix for the test is available on PR #521

Problem 2 - order of some attributes changed in the DocumentNode object

This is a low-level implementation detail which should not have any impact.
The node_tree method of gql used for debugging should be fixed to allow for those changes.
In the PR #520, the node_tree method has been modified to sort the elements and thus ignore those changes.

Problem 3 - requests.exceptions.ConnectionError errors

For some reason, there are now ConnectionError for some tests. This should be investigated further.

EDIT: The problem is that those tests are using vcr cassettes, which are expecting the old version of the introspection query

@leszekhanusz leszekhanusz added the type: bug An issue or pull request relating to a bug label Jan 27, 2025
@leszekhanusz
Copy link
Collaborator Author

To fix the error in problem 3, in PR #523, gql is now using its own version of the get_introspection_query method.

This would reset the recursion level at the previous level before the breaking change (7 instead of 9).

If anyone needs more recursion levels for the introspection query, this would be possible by using the type_recursion_level argument, like this:

client = Client(                                                                                                  
      transport=transport,                                                                                                          
      fetch_schema_from_transport=True,                                                                           
      introspection_args= {                                                                                       
          "type_recursion_level": 9,                                                                               
      },                                                                                                          
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug An issue or pull request relating to a bug
Projects
None yet
Development

No branches or pull requests

1 participant