Skip to content

Commit

Permalink
fix: track transferred subgraphs despite inactive status
Browse files Browse the repository at this point in the history
  • Loading branch information
Theodus committed Aug 14, 2023
1 parent da71648 commit b6ce652
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion graph-gateway/src/client_query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion graph-gateway/src/network_subgraph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ impl Client {
first: $first
where: {{
id_gt: $last
active: true
entityVersion: 2
{}
}}
) {{
id
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit b6ce652

Please sign in to comment.