blocks.rs

Overview

This file defines core types and structures used for querying and paginating blockchain block data within the system. It provides query argument structures, type aliases, and GraphQL connection and edge types that facilitate efficient and paginated retrieval of blockchain blocks. The module leverages traits from the async_graphql crate to implement the GraphQL connection pattern, enabling standardized pagination support for blockchain block queries.

Detailed Explanation of Components

Type Alias

pub(crate) type BlockchainBlock = Block;

Struct: BlockchainBlocksQueryArgs

#[derive(Clone)]
pub struct BlockchainBlocksQueryArgs {
    pub block_seq_no_range: Option<BlockchainMasterSeqNoFilter>,
    pub min_tr_count: Option<i32>,
    pub max_tr_count: Option<i32>,
    pub pagination: PaginationArgs,
}

Struct: BlockchainBlocksEdge

pub(crate) struct BlockchainBlocksEdge;

Struct: BlockchainBlocksConnection

pub(crate) struct BlockchainBlocksConnection;

Implementation Details and Algorithms

Interaction with Other System Parts


Mermaid Class Diagram

classDiagram
class BlockchainBlocksQueryArgs {
+block_seq_no_range: Option<BlockchainMasterSeqNoFilter>
+min_tr_count: Option<i32>
+max_tr_count: Option<i32>
+pagination: PaginationArgs
}
class BlockchainBlocksEdge {
+type_name() : String
}
class BlockchainBlocksConnection {
+type_name() : String
}
BlockchainBlocksEdge ..|> EdgeNameType
BlockchainBlocksConnection ..|> ConnectionNameType

This diagram illustrates the main data structures and their relationships, highlighting the inheritance of traits for GraphQL connection types and the fields used for querying blockchain blocks.