From 1be43e156f686a034733ae34831088e97a401b2a Mon Sep 17 00:00:00 2001 From: Will Yang Date: Thu, 26 Oct 2023 15:03:50 -0700 Subject: [PATCH] ok --- crates/sui-graphql-rpc/src/context_data/db_data_provider.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/sui-graphql-rpc/src/context_data/db_data_provider.rs b/crates/sui-graphql-rpc/src/context_data/db_data_provider.rs index 4a326d970301dc..3f41fb5c6db3b7 100644 --- a/crates/sui-graphql-rpc/src/context_data/db_data_provider.rs +++ b/crates/sui-graphql-rpc/src/context_data/db_data_provider.rs @@ -195,8 +195,11 @@ impl QueryBuilder { after_tx_seq_num: Option, before_tx_seq_num: Option, ) -> Result, Error> { + let mut query = transactions::dsl::transactions.into_boxed(); if let Some(cursor_val) = cursor { + if descending_order { + let filter_value = before_tx_seq_num.map_or(cursor_val, |b| std::cmp::min(b, cursor_val)); query = query.filter(transactions::dsl::tx_sequence_number.lt(filter_value)); } else {