diff --git a/ethereum/api/src/main/resources/schema.graphqls b/ethereum/api/src/main/resources/schema.graphqls index b065daf502..f06cb2e243 100644 --- a/ethereum/api/src/main/resources/schema.graphqls +++ b/ethereum/api/src/main/resources/schema.graphqls @@ -257,12 +257,21 @@ type SyncState{ knownStates: Long } +input TransactionOrderByNonce { + nonce: Sort +} + +enum Sort { + asc + desc +} + # Pending represents the current pending state. type Pending { # TransactionCount is the number of transactions in the pending state. transactionCount: Int! # Transactions is a list of transactions in the current pending state. - transactions: [Transaction!] + transactions(orderBy: TransactionOrderByNonce): [Transaction!] # Account fetches an Ethereum account for the pending state. account(address: Address!): Account! # Call executes a local call operation for the pending state. diff --git a/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/graphql/graphql_pending.json b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/graphql/graphql_pending.json index 46cad8c1c7..8cbdccca14 100644 --- a/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/graphql/graphql_pending.json +++ b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/graphql/graphql_pending.json @@ -1,6 +1,6 @@ { "request": - "{ pending { transactionCount transactions { nonce gas } account(address:\"0x6295ee1b4f6dd65047762f924ecd367c17eabf8f\") { balance} estimateGas(data:{}) call (data : {from : \"0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b\", to: \"0x6295ee1b4f6dd65047762f924ecd367c17eabf8f\", data :\"0x12a7b914\"}){data status}} }", + "{ pending { transactionCount transactions(orderBy: {nonce: asc}) { nonce gas } account(address:\"0x6295ee1b4f6dd65047762f924ecd367c17eabf8f\") { balance} estimateGas(data:{}) call (data : {from : \"0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b\", to: \"0x6295ee1b4f6dd65047762f924ecd367c17eabf8f\", data :\"0x12a7b914\"}){data status}} }", "response": { "data": {