graphql-compiler icon indicating copy to clipboard operation
graphql-compiler copied to clipboard

Improve type checking in query pagination and AST manipulation code.

Open obi1kenobi opened this issue 5 years ago • 2 comments

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.

obi1kenobi avatar Aug 11 '20 16:08 obi1kenobi

Codecov Report

Merging #898 into main will decrease coverage by 0.09%. The diff coverage is 90.32%.

Impacted file tree graph

@@            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 data Powered by Codecov. Last update 5c4e232...259d287. Read the comment docs.

codecov[bot] avatar Aug 11 '20 20:08 codecov[bot]

@bojanserafimov I'd love a re-review here when you get the chance.

obi1kenobi avatar Sep 29 '20 14:09 obi1kenobi