Improve type checking in query pagination and AST manipulation code.
Includes type-level fixes for handling InlineFragmentNode AST values in query pagination code, a couple of new helper functions, and type hints for the AST manipulation module.
Based on the tests passing and my careful refactoring, I am fairly confident that I haven't made pagination any worse. However, I opened #897 to verify that query pagination in the presence of type coercions (signaled by InlineFragmentNode AST values) actually works.
This is quite a tricky PR, so I'd like to have @bojanserafimov review it before we merge, in addition to anyone else that might want to check it out.
Codecov Report
Merging #898 into main will decrease coverage by
0.09%. The diff coverage is90.32%.
@@ Coverage Diff @@
## main #898 +/- ##
==========================================
- Coverage 95.07% 94.98% -0.10%
==========================================
Files 111 111
Lines 8788 8767 -21
==========================================
- Hits 8355 8327 -28
- Misses 433 440 +7
| Impacted Files | Coverage Δ | |
|---|---|---|
| ...l_compiler/query_pagination/query_parameterizer.py | 93.96% <84.61%> (-3.21%) |
:arrow_down: |
| graphql_compiler/ast_manipulation.py | 89.83% <90.00%> (-2.17%) |
:arrow_down: |
| graphql_compiler/global_utils.py | 98.41% <100.00%> (+0.16%) |
:arrow_up: |
| ...l_compiler/query_pagination/pagination_planning.py | 92.06% <100.00%> (ø) |
|
| graphql_compiler/typedefs.py | 85.71% <0.00%> (-14.29%) |
:arrow_down: |
| graphql_compiler/schema_generation/schema_graph.py | 77.37% <0.00%> (-1.71%) |
:arrow_down: |
| graphql_compiler/compiler/filters.py | 94.07% <0.00%> (-0.30%) |
:arrow_down: |
| graphql_compiler/schema/schema_info.py | 89.36% <0.00%> (-0.23%) |
:arrow_down: |
| graphql_compiler/cost_estimation/statistics.py | 92.85% <0.00%> (-0.20%) |
:arrow_down: |
| ... and 6 more |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update 5c4e232...259d287. Read the comment docs.
@bojanserafimov I'd love a re-review here when you get the chance.