diff --git a/blockscout-ens/bens-logic/src/subgraphs_reader/sql/utils.rs b/blockscout-ens/bens-logic/src/subgraphs_reader/sql/utils.rs index e11674e69..7723ef4ba 100644 --- a/blockscout-ens/bens-logic/src/subgraphs_reader/sql/utils.rs +++ b/blockscout-ens/bens-logic/src/subgraphs_reader/sql/utils.rs @@ -16,6 +16,16 @@ pub fn union_domain_queries( ) -> Result { let select_clause = Expr::cust(select_clause.unwrap_or("*")); let sub_query = protocol_queries + .into_iter() + .map(|mut q| { + if let Some(pagination) = pagination { + pagination + .add_to_query(&mut q) + .context("adding pagination to query")?; + } + Ok(q.to_owned()) + }) + .collect::, anyhow::Error>>()? .into_iter() .reduce(|mut acc, new| acc.union(UnionType::All, new).to_owned()) .expect("reduce from non empty iterator");