Skip to content

Commit

Permalink
fix(fed): bring in commit
Browse files Browse the repository at this point in the history
  • Loading branch information
duckki authored and lrlna committed Jun 17, 2024
1 parent 39b2df3 commit 5065349
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
6 changes: 5 additions & 1 deletion apollo-federation/src/query_plan/fetch_dependency_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3062,6 +3062,10 @@ fn compute_nodes_for_key_resolution<'a>(
let dest = stack_item.tree.graph.node_weight(dest_id)?;
// We shouldn't have a key on a non-composite type
let source_type: CompositeTypeDefinitionPosition = source.type_.clone().try_into()?;
let source_schema: ValidFederationSchema = dependency_graph
.federated_query_graph
.schema_by_source(&source.source)?
.clone();
let dest_type: CompositeTypeDefinitionPosition = dest.type_.clone().try_into()?;
let dest_schema: ValidFederationSchema = dependency_graph
.federated_query_graph
Expand Down Expand Up @@ -3153,7 +3157,7 @@ fn compute_nodes_for_key_resolution<'a>(
let node =
FetchDependencyGraph::node_weight_mut(&mut dependency_graph.graph, stack_item.node_id)?;
let typename_field = Arc::new(OpPathElement::Field(Field::new_introspection_typename(
&dependency_graph.supergraph_schema,
&source_schema,
&source_type,
None,
)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,6 @@ fn can_use_a_key_on_an_interface_object_type() {
}

#[test]
#[should_panic(
expected = r#"Cannot add selection of field "I.__typename" to selection set of parent type "I" that is potentially an interface object type at runtime"#
)]
// TODO: investigate this failure
fn can_use_a_key_on_an_interface_object_from_an_interface_object_type() {
let planner = planner!(
S1: SUBGRAPH1,
Expand Down Expand Up @@ -229,9 +225,10 @@ fn does_not_rely_on_an_interface_object_directly_for_typename() {

#[test]
#[should_panic(
expected = r#"Cannot add selection of field "I.__typename" to selection set of parent type "I" that is potentially an interface object type at runtime"#
expected = r#"Cannot add selection of field "I.id" to selection set of parent type "A""#
)]
// TODO: investigate this failure
// - Fails to rebase on an interface object type in a subgraph.
fn does_not_rely_on_an_interface_object_directly_if_a_specific_implementation_is_requested() {
let planner = planner!(
S1: SUBGRAPH1,
Expand Down Expand Up @@ -374,10 +371,6 @@ fn can_use_a_key_on_an_interface_object_type_even_for_a_concrete_implementation(
}

#[test]
#[should_panic(
expected = r#"Cannot add selection of field "I.__typename" to selection set of parent type "I" that is potentially an interface object type at runtime"#
)]
// TODO: investigate this failure
fn handles_query_of_an_interface_field_for_a_specific_implementation_when_query_starts_with_interface_object(
) {
let planner = planner!(
Expand Down Expand Up @@ -434,9 +427,10 @@ fn handles_query_of_an_interface_field_for_a_specific_implementation_when_query_

#[test]
#[should_panic(
expected = r#"Cannot add selection of field "I.__typename" to selection set of parent type "I" that is potentially an interface object type at runtime"#
expected = r#"Cannot add selection of field "I.id" to selection set of parent type "A""#
)]
// TODO: investigate this failure
// - Fails to rebase on an interface object type in a subgraph.
fn it_avoids_buffering_interface_object_results_that_may_have_to_be_filtered_with_lists() {
let planner = planner!(
S1: r#"
Expand Down

0 comments on commit 5065349

Please sign in to comment.