-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed error when relationships used in BooleanExpressionTypes were no…
…t handled correctly in partial supergraph mode (#1182) ### What When the engine is run in `PARTIAL_SUPERGRAPH` mode, any relationship that targets an unknown subgraph should be silently dropped. This was being done when resolving relationship navigation fields on the `ObjectType`, but not for `comparableRelationships` on `BooleanExpressionType`. In that case we were erroring as we tried to resolve the relationship and couldn't find the target subgraph. ### How The `relationships` metadata resolve step has been enhanced to capture if a relationship is targeting an unknown subgraph. The `object_boolean_expressions` step already used this, so it was tweaked to skip relationships targeting unknown subgraphs. The `object_relationships` step, however, did not use `relationships` and instead went back to metadata_accessor for relationships. It then had special logic that skipped unknown subgraph relationships. The step has now been refactored to use `relationships` instead and the special skipping logic has been discarded, and it now just uses the unknown subgraph information from `relationships`. In addition, the `object_relationships` step now _consumes_ the output of the `type_permissions` step, rather than cloning it. This reduces unnecessary cloning and makes sense since `object_relationships` is simply a further enriched version of `type_permissions`. The test of whether the source object type of a relationship actually exists has also been moved from `object_relationships` to `relationships`, and the index built by `relationships` has been reordered to group by type first and then name, since that is more useful, especially in the `object_relationships` step. V3_GIT_ORIGIN_REV_ID: e5d18343f5ce24532a3258e88751bc3183692c50
- Loading branch information
1 parent
81bddc1
commit 017e1e2
Showing
10 changed files
with
239 additions
and
191 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
use open_dds::{ | ||
identifier::SubgraphName, | ||
relationships::{RelationshipTarget, RelationshipV1}, | ||
}; | ||
|
||
pub fn get_target_subgraph(relationship: &RelationshipV1) -> Option<SubgraphName> { | ||
match &relationship.target { | ||
RelationshipTarget::Model(model_target) => model_target.subgraph(), | ||
RelationshipTarget::Command(command_target) => command_target.subgraph(), | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.