Skip to content
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

test: updated plan_simple_root_field_query_for_multiple_subgraphs test #5455

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 62 additions & 21 deletions apollo-federation/src/query_plan/query_planner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -994,10 +994,7 @@ type User
"###);
}

// TODO: This fails with "Subgraph unexpectedly does not use federation spec"
// which seems...unusual
#[test]
#[ignore]
dariuszkuc marked this conversation as resolved.
Show resolved Hide resolved
fn plan_simple_root_field_query_for_multiple_subgraphs() {
let supergraph = Supergraph::new(TEST_SUPERGRAPH).unwrap();
let planner = QueryPlanner::new(&supergraph, Default::default()).unwrap();
Expand All @@ -1021,26 +1018,70 @@ type User
.unwrap();
let plan = planner.build_query_plan(&document, None).unwrap();
insta::assert_snapshot!(plan, @r###"
QueryPlan {
Parallel {
Fetch(service: "accounts") {
{
QueryPlan {
Parallel {
Fetch(service: "accounts") {
{
userById(id: 1) {
name
email
}
}
}
Fetch(service: "products") {
{
bestRatedProducts {
id
avg_rating
}
name
email
}
}
},
Sequence {
Fetch(service: "reviews") {
{
bestRatedProducts {
__typename
id
... on Book {
__typename
id
reviews {
rating
}
}
... on Movie {
__typename
id
reviews {
rating
}
}
}
}
},
Flatten(path: "bestRatedProducts.@") {
Fetch(service: "products") {
{
... on Book {
__typename
id
reviews {
rating
}
}
... on Movie {
__typename
id
reviews {
rating
}
}
} =>
{
... on Book {
avg_rating
}
... on Movie {
avg_rating
}
}
},
},
},
},
}
}
}
}
"###);
}

Expand Down
Loading