mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
start adapting queries
This commit is contained in:
parent
4f9cd4a7f8
commit
76bb997fe1
@ -12,12 +12,19 @@ import useNetworkMetadata, {
|
|||||||
import { LoggerInstance } from '@oceanprotocol/lib'
|
import { LoggerInstance } from '@oceanprotocol/lib'
|
||||||
import styles from './MarketStats.module.css'
|
import styles from './MarketStats.module.css'
|
||||||
|
|
||||||
const getTotalPoolsValues = gql`
|
const getGlobalStatsValues = gql`
|
||||||
query PoolsData {
|
query FooterStatsValues {
|
||||||
poolFactories {
|
globalStats(subgraphError: deny) {
|
||||||
totalValueLocked
|
poolCount
|
||||||
totalOceanLiquidity
|
nftCount
|
||||||
finalizedPoolCount
|
datatokenCount
|
||||||
|
orderCount
|
||||||
|
totalLiquidity {
|
||||||
|
token {
|
||||||
|
id
|
||||||
|
}
|
||||||
|
value
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`
|
`
|
||||||
@ -121,11 +128,11 @@ export default function MarketStats(): ReactElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await fetchData(getTotalPoolsValues, null, context)
|
const response = await fetchData(getGlobalStatsValues, null, context)
|
||||||
if (!response) continue
|
if (!response) continue
|
||||||
|
|
||||||
const { totalValueLocked, totalOceanLiquidity, finalizedPoolCount } =
|
const { totalValueLocked, totalOceanLiquidity, finalizedPoolCount } =
|
||||||
response?.data?.poolFactories[0]
|
response?.data?.globalStats[0]
|
||||||
|
|
||||||
await setTotalValueLocked((prevState) => ({
|
await setTotalValueLocked((prevState) => ({
|
||||||
...prevState,
|
...prevState,
|
||||||
|
Loading…
Reference in New Issue
Block a user