Skip to content

Commit

Permalink
moved tps and dashboard blocks to explorer.graphql
Browse files Browse the repository at this point in the history
  • Loading branch information
raghukapur9 committed Sep 22, 2024
1 parent b5ba01f commit 22d1509
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 25 deletions.
24 changes: 24 additions & 0 deletions packages/graphql/src/graphql/schemas/explorer.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -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!]!
}
2 changes: 1 addition & 1 deletion packages/graphql/src/infra/dao/BlockDAO.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ export default class BlockDAO {
[timeMinusOneDayRoundDownISO],
);

if (!blocksData) {
if (blocksData.length === 0) {
return { nodes: [] };
}

Expand Down
24 changes: 0 additions & 24 deletions packages/graphql/src/schemas/fuelcore.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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!]!
}

0 comments on commit 22d1509

Please sign in to comment.