Skip to content

Commit

Permalink
port Transaction total_count fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ecioppettini committed Nov 18, 2021
1 parent 01658a8 commit e885a06
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions explorer/src/api/graphql/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,9 @@ impl Block {
last: Option<i32>,
before: Option<String>,
after: Option<String>,
) -> FieldResult<Connection<IndexCursor, Transaction, EmptyFields, EmptyFields>> {
) -> FieldResult<
Connection<IndexCursor, Transaction, ConnectionFields<TransactionCount>, EmptyFields>,
> {
let explorer_block = self
.fetch_explorer_block(&extract_context(&context).db)
.await?;
Expand Down Expand Up @@ -591,8 +593,13 @@ impl Block {
};

let (range, page_meta) = compute_interval(boundaries, pagination_arguments)?;
let mut connection =
Connection::new(page_meta.has_previous_page, page_meta.has_next_page);
let mut connection = Connection::with_additional_fields(
page_meta.has_previous_page,
page_meta.has_next_page,
ConnectionFields {
total_count: page_meta.total_count,
},
);

let edges = match range {
PaginationInterval::Empty => vec![],
Expand Down

0 comments on commit e885a06

Please sign in to comment.