Update graphql pending to allow txn sorting (#1450)

* Update graphql pending to allow for sorting of transactions

Signed-off-by: David Mechler <david.mechler@consensys.net>
pull/1454/head
David Mechler 4 years ago committed by GitHub
parent dbc3fee7bb
commit 75d6016081
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 11
      ethereum/api/src/main/resources/schema.graphqls
  2. 2
      ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/graphql/graphql_pending.json

@ -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.

@ -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": {

Loading…
Cancel
Save