diff --git a/graph-gateway/src/client_query.rs b/graph-gateway/src/client_query.rs index fadaaf443..6a3b97e37 100644 --- a/graph-gateway/src/client_query.rs +++ b/graph-gateway/src/client_query.rs @@ -145,7 +145,7 @@ pub async fn handle_query( let l2_subgraph_id = subgraph.and_then(|s| s.l2_id); let deployments_migrated = matches!( resolved_deployments.as_ref(), - Ok((deployments, _)) if deployments.iter().all(|d| d.transferred_to_l2), + Ok((deployments, _)) if deployments.iter().all(|d| d.indexers.is_empty()), ); if l2_subgraph_id.is_some() || (subgraph.is_none() && deployments_migrated) { // We validate the configuration correctness at startup: L2 transfer redirection requires diff --git a/graph-gateway/src/network_subgraph.rs b/graph-gateway/src/network_subgraph.rs index 886e96a65..b2f74c512 100644 --- a/graph-gateway/src/network_subgraph.rs +++ b/graph-gateway/src/network_subgraph.rs @@ -144,8 +144,8 @@ impl Client { first: $first where: {{ id_gt: $last - active: true entityVersion: 2 + {} }} ) {{ id @@ -173,6 +173,9 @@ impl Client { }} }} "#, + self.l2_transfer_support + .then_some("") + .unwrap_or("active: true"), self.l2_transfer_support.then_some("idOnL2").unwrap_or(""), self.l2_transfer_support .then_some("startedTransferToL2At")