Skip to content

Commit

Permalink
refactor!: drop support for average aggregation fields
Browse files Browse the repository at this point in the history
This is outlying statistical data that can be calculated externally.
  • Loading branch information
rhyslbw committed Feb 3, 2023
1 parent ad4e736 commit 3cd6445
Show file tree
Hide file tree
Showing 24 changed files with 1 addition and 179 deletions.
91 changes: 0 additions & 91 deletions packages/api-cardano-db-hasura/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -281,17 +281,12 @@ type ActiveStake_aggregate {
}

type ActiveStake_aggregate_fields {
avg: ActiveStake_avg_fields!
count: String!
max: ActiveStake_max_fields!
min: ActiveStake_min_fields!
sum: ActiveStake_sum_fields!
}

type ActiveStake_avg_fields {
amount: String
}

type ActiveStake_max_fields {
amount: Lovelace
}
Expand Down Expand Up @@ -516,18 +511,12 @@ type CollateralInput_aggregate {
}

type CollateralInput_aggregate_fields {
avg: CollateralInput_avg_fields!
count: String!
max: CollateralInput_max_fields!
min: CollateralInput_min_fields!
sum: CollateralInput_sum_fields!
}

type CollateralInput_avg_fields {
tokens: Token_avg_fields
value: String
}

type CollateralInput_max_fields {
tokens: Token_max_fields
value: Lovelace
Expand Down Expand Up @@ -586,17 +575,12 @@ type CollateralOutput_aggregate {
}

type CollateralOutput_aggregate_fields {
avg: CollateralOutput_avg_fields!
count: String!
max: CollateralOutput_max_fields!
min: CollateralOutput_min_fields!
sum: CollateralOutput_sum_fields!
}

type CollateralOutput_avg_fields {
value: String
}

type CollateralOutput_max_fields {
value: Lovelace
}
Expand Down Expand Up @@ -691,19 +675,12 @@ type Redeemer_aggregate {
}

type Redeemer_aggregate_fields {
avg: Redeemer_avg_fields!
count: String!
max: Redeemer_max_fields!
min: Redeemer_min_fields!
sum: Redeemer_sum_fields!
}

type Redeemer_avg_fields {
fee: String
unitMem: String
unitSteps: String
}

type Redeemer_max_fields {
fee: String
unitMem: String
Expand Down Expand Up @@ -777,17 +754,12 @@ type Reward_aggregate {
}

type Reward_aggregate_fields {
avg: Reward_avg_fields!
count: String!
max: Reward_max_fields!
min: Reward_min_fields!
sum: Reward_sum_fields!
}

type Reward_avg_fields {
amount: String
}

type Reward_max_fields {
amount: Lovelace
}
Expand Down Expand Up @@ -833,17 +805,12 @@ type Script_aggregate {
}

type Script_aggregate_fields {
avg: Script_avg_fields!
count: String!
max: Script_max_fields!
min: Script_min_fields!
sum: Script_sum_fields!
}

type Script_avg_fields {
serialisedSize: Float
}

type Script_max_fields {
serialisedSize: Int
}
Expand Down Expand Up @@ -1091,19 +1058,12 @@ type StakePool_aggregate {
}

type StakePool_aggregate_fields {
avg: StakePool_avg_fields!
count: String!
max: StakePool_max_fields!
min: StakePool_min_fields!
sum: StakePool_sum_fields!
}

type StakePool_avg_fields {
fixedCost: Lovelace
margin: Float
pledge: Lovelace
}

type StakePool_max_fields {
fixedCost: Lovelace
margin: Float
Expand Down Expand Up @@ -1207,17 +1167,12 @@ type Token_aggregate {
}

type Token_aggregate_fields {
avg: Token_avg_fields!
count: String!
max: Token_max_fields!
min: Token_min_fields!
sum: Token_sum_fields!
}

type Token_avg_fields {
quantity: String
}

type Token_max_fields {
quantity: String
}
Expand Down Expand Up @@ -1262,17 +1217,12 @@ enum TokenMint_aggregate_distinct_on {
}

type TokenMint_aggregate_fields {
avg: TokenMint_avg_fields!
count: String!
max: TokenMint_max_fields!
min: TokenMint_min_fields!
sum: TokenMint_sum_fields!
}

type TokenMint_avg_fields {
quantity: String
}

type TokenMint_max_fields {
quantity: String
}
Expand Down Expand Up @@ -1428,23 +1378,12 @@ type Transaction_aggregate {
}

type Transaction_aggregate_fields {
avg: Transaction_avg_fields!
count: String!
max: Transaction_max_fields!
min: Transaction_min_fields!
sum: Transaction_sum_fields!
}

type Transaction_avg_fields {
deposit: String
fee: String
mint: Token_avg_fields
scriptSize: Float
size: Float
totalOutput: String
withdrawals: Withdrawal_avg_fields
}

type Transaction_max_fields {
deposit: Lovelace
fee: Lovelace
Expand Down Expand Up @@ -1516,18 +1455,12 @@ type TransactionInput_aggregate {
}

type TransactionInput_aggregate_fields {
avg: TransactionInput_avg_fields!
count: String!
max: TransactionInput_max_fields!
min: TransactionInput_min_fields!
sum: TransactionInput_sum_fields!
}

type TransactionInput_avg_fields {
tokens: Token_avg_fields
value: String
}

type TransactionInput_max_fields {
tokens: Token_max_fields
value: Lovelace
Expand Down Expand Up @@ -1598,18 +1531,12 @@ type TransactionOutput_aggregate {
}

type TransactionOutput_aggregate_fields {
avg: TransactionOutput_avg_fields!
count: String!
max: TransactionOutput_max_fields!
min: TransactionOutput_min_fields!
sum: TransactionOutput_sum_fields!
}

type TransactionOutput_avg_fields {
tokens: Token_avg_fields
value: String
}

type TransactionOutput_max_fields {
tokens: Token_max_fields
value: Lovelace
Expand Down Expand Up @@ -1701,18 +1628,12 @@ type Block_aggregate {
}

type Block_aggregate_fields {
avg: Block_avg_fields!
count: String!
max: Block_max_fields!
min: Block_min_fields!
sum: Block_sum_fields!
}

type Block_avg_fields {
fees: String
size: Float
}

type Block_max_fields {
fees: Lovelace
size: Int
Expand Down Expand Up @@ -1781,19 +1702,12 @@ type Epoch_aggregate {
}

type Epoch_aggregate_fields {
avg: Epoch_avg_fields!
count: String!
max: Epoch_max_fields!
min: Epoch_min_fields!
sum: Epoch_sum_fields!
}

type Epoch_avg_fields {
fees: String!
output: String!
transactionsCount: Float!
}

type Epoch_max_fields {
blocksCount: Int!
fees: Lovelace!
Expand Down Expand Up @@ -1844,16 +1758,11 @@ type Withdrawal_aggregate {

type Withdrawal_aggregate_fields {
count: String!
avg: Withdrawal_avg_fields!
max: Withdrawal_max_fields!
min: Withdrawal_min_fields!
sum: Withdrawal_sum_fields!
}

type Withdrawal_avg_fields {
amount: Lovelace
}

type Withdrawal_max_fields {
amount: Lovelace
}
Expand Down
6 changes: 0 additions & 6 deletions packages/api-cardano-db-hasura/src/HasuraClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,6 @@ export class HasuraClient {
}
tokenMints_aggregate {
aggregate {
avg {
quantity
}
count
max {
quantity
Expand Down Expand Up @@ -290,9 +287,6 @@ export class HasuraClient {
tokenMints: [],
tokenMints_aggregate: {
aggregate: {
avg: {
quantity: 'na'
},
count: 'na',
max: {
quantity: 'na'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ query averageActiveStakeForAddress (
activeStake_aggregate (where: { address: { _eq: $address }}) {
aggregate {
count
avg {
amount
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@ query aggregatedDataWithinBlock (
]}) {
transactions_aggregate {
aggregate {
avg {
fee
size
totalOutput
}
count
max {
fee
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
query collateralInputsAggregate {
collateralInputs_aggregate {
aggregate {
avg {
value
}
max {
value
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
query collateralOutputsAggregate {
collateralOutputs_aggregate {
aggregate {
avg {
value
}
max {
value
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ query aggregatedDataWithinEpoch (
}
blocks_aggregate {
aggregate {
avg {
fees
size
}
count
max {
fees
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
query redeemersAggregate {
redeemers_aggregate {
aggregate {
avg {
fee
unitMem
unitSteps
}
max {
fee
unitMem
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
query allRewardsAggregateFields {
rewards_aggregate {
aggregate {
avg {
amount
}
count
max {
amount
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
query scriptsAggregate {
scripts_aggregate {
aggregate {
avg {
serialisedSize
}
max {
serialisedSize
}
Expand Down
Loading

0 comments on commit 3cd6445

Please sign in to comment.