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

FED-251: fixed inputs_for_require to use the entity_type/schema #5460

Merged
merged 1 commit into from
Jun 15, 2024
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -3856,6 +3856,7 @@ fn handle_requires(
let inputs = inputs_for_require(
dependency_graph,
entity_type_position.clone(),
entity_type_schema,
query_graph_edge_id,
context,
false,
Expand Down Expand Up @@ -4028,6 +4029,7 @@ fn defer_context_for_conditions(base_context: &DeferContext) -> DeferContext {
fn inputs_for_require(
fetch_dependency_graph: &mut FetchDependencyGraph,
entity_type_position: ObjectTypeDefinitionPosition,
entity_type_schema: ValidFederationSchema,
query_graph_edge_id: EdgeIndex,
context: &OpGraphPathContext,
include_key_inputs: bool,
Expand Down Expand Up @@ -4112,7 +4114,7 @@ fn inputs_for_require(
// should just use `entity_type` (that @interfaceObject type), not input type which will be an implementation the
// subgraph does not know in that particular case.
let mut key_inputs =
SelectionSet::for_composite_type(edge_conditions.schema.clone(), input_type.clone());
SelectionSet::for_composite_type(entity_type_schema, entity_type_position.into());
key_inputs.add_selection_set(&key_condition)?;

Ok((
Expand Down Expand Up @@ -4152,6 +4154,7 @@ fn add_post_require_inputs(
let (inputs, key_inputs) = inputs_for_require(
dependency_graph,
entity_type_position.clone(),
entity_type_schema.clone(),
query_graph_edge_id,
context,
true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,11 +224,8 @@ fn does_not_rely_on_an_interface_object_directly_for_typename() {
}

#[test]
#[should_panic(
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.
#[should_panic(expected = r#"snapshot assertion"#)]
// TODO: investigate this failure (missing fetch node for `iFromS2 { ... on I { y } }`)
fn does_not_rely_on_an_interface_object_directly_if_a_specific_implementation_is_requested() {
let planner = planner!(
S1: SUBGRAPH1,
Expand Down Expand Up @@ -426,11 +423,8 @@ fn handles_query_of_an_interface_field_for_a_specific_implementation_when_query_
}

#[test]
#[should_panic(
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.
#[should_panic(expected = r#"snapshot assertion"#)]
// TODO: investigate this failure (missing fetch node for "everything.@ { ... on I { expansiveField } }")
fn it_avoids_buffering_interface_object_results_that_may_have_to_be_filtered_with_lists() {
let planner = planner!(
S1: r#"
Expand Down
Loading