diff --git a/packages/graphql/src/graphql/schemas/explorer.graphql b/packages/graphql/src/graphql/schemas/explorer.graphql index 9f1d4bc44..f4a0fa195 100644 --- a/packages/graphql/src/graphql/schemas/explorer.graphql +++ b/packages/graphql/src/graphql/schemas/explorer.graphql @@ -223,4 +223,28 @@ type Query { search(query: String!): SearchResult predicate(address: String!): PredicateItem + tps: TPSConnection! + getBlocksDashboard : BlocksDashboardConnection! } + +type TPS { + start: String + end: String + txCount: U64! + totalGas: U64! +} + +type TPSConnection { + nodes: [TPS!]! +} + +type BlocksDashboard { + timestamp: U64! + gasUsed: U64! + blockNo: U64! + producer: String +} + +type BlocksDashboardConnection { + nodes: [BlocksDashboard!]! +} \ No newline at end of file diff --git a/packages/graphql/src/infra/dao/BlockDAO.ts b/packages/graphql/src/infra/dao/BlockDAO.ts index acc7aa4b8..cf9436204 100644 --- a/packages/graphql/src/infra/dao/BlockDAO.ts +++ b/packages/graphql/src/infra/dao/BlockDAO.ts @@ -177,7 +177,7 @@ export default class BlockDAO { [timeMinusOneDayRoundDownISO], ); - if (!blocksData) { + if (blocksData.length === 0) { return { nodes: [] }; } diff --git a/packages/graphql/src/schemas/fuelcore.graphql b/packages/graphql/src/schemas/fuelcore.graphql index 9b8352dac..f265af58a 100644 --- a/packages/graphql/src/schemas/fuelcore.graphql +++ b/packages/graphql/src/schemas/fuelcore.graphql @@ -782,8 +782,6 @@ type Query { ): Transaction transactions(after: String, before: String, first: Int, last: Int): TransactionConnection! transactionsByOwner(after: String, before: String, first: Int, last: Int, owner: Address!): TransactionConnection! - tps: TPSConnection! - getBlocksDashboard : BlocksDashboardConnection! } type Receipt { @@ -1024,26 +1022,4 @@ type VariableOutput { amount: U64! assetId: AssetId! to: Address! -} - -type TPS { - start: String - end: String - txCount: U64! - totalGas: U64! -} - -type TPSConnection { - nodes: [TPS!]! -} - -type BlocksDashboard { - timestamp: U64! - gasUsed: U64! - blockNo: U64! - producer: String -} - -type BlocksDashboardConnection { - nodes: [BlocksDashboard!]! } \ No newline at end of file