kensho-technologies / graphql-compiler

Turn complex GraphQL queries into optimized database queries.
Apache License 2.0
550 stars 50 forks source link

Schema renaming: Interface implementation suppression #1002

Open LWprogramming opened 3 years ago

LWprogramming commented 3 years ago

Interfaces present a challenge for schema renaming that don't show up with regular object types uninvolved with interfaces.

This PR implements suppressing object types that implement interfaces. The main issue is that suppress an object type Foo that implements an interface Bar can cause problems if, later on, someone queries for all objects that implement Bar and ends up getting objects of suppressed type Foo. If this happens, we remove the interface (as well as all its ancestor interfaces*) from RootSchemaQuery to make it unqueryable.

*For the directed graph consisting of all types in the schema as nodes and the edges are from an interface to a type that implements it (for every such interface and type pair), an interface is an ancestor of another type iff there's a path from the interface's node to that type's node.

codecov[bot] commented 3 years ago

Codecov Report

Merging #1002 (ee3048c) into main (44c63aa) will increase coverage by 0.02%. The diff coverage is 100.00%.

:exclamation: Current head ee3048c differs from pull request most recent head 2d997ee. Consider uploading reports for the commit 2d997ee to get more accurate results Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1002      +/-   ##
==========================================
+ Coverage   94.38%   94.40%   +0.02%     
==========================================
  Files         113      113              
  Lines        9080     9133      +53     
==========================================
+ Hits         8570     8622      +52     
- Misses        510      511       +1     
Impacted Files Coverage Δ
...ql_compiler/schema_transformation/rename_schema.py 99.66% <100.00%> (-0.34%) :arrow_down:

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 44c63aa...2d997ee. Read the comment docs.