diff --git a/.gitignore b/.gitignore index 455176b6c..02737136c 100644 --- a/.gitignore +++ b/.gitignore @@ -10,7 +10,7 @@ coverage .vercel repo-metadata.json networks-metadata.json -src/@types/apollo +src/@types/subgraph graphql.schema.json src/@types/graph.types.ts tsconfig.tsbuildinfo diff --git a/apollo.config.js b/apollo.config.js deleted file mode 100644 index 6d3d361c5..000000000 --- a/apollo.config.js +++ /dev/null @@ -1,10 +0,0 @@ -module.exports = { - client: { - service: { - name: 'ocean', - url: 'https://subgraphv4.rinkeby.oceanprotocol.com/subgraphs/name/oceanprotocol/ocean-subgraph', - // optional disable SSL validation check - skipSSLValidation: true - } - } -} diff --git a/package.json b/package.json index 886d02cf3..320c9e05f 100644 --- a/package.json +++ b/package.json @@ -10,13 +10,12 @@ "serve": "serve -s public/", "pregenerate": "bash scripts/pregenerate.sh", "test": "npm run pregenerate && npm run lint && npm run type-check", - "test:graphql": "npm run codegen:graphql && npm run lint", "lint": "eslint --ignore-path .gitignore --ext .js --ext .ts --ext .tsx .", "format": "prettier --ignore-path .gitignore './**/*.{css,yml,js,ts,tsx,json}' --write", "type-check": "tsc --noEmit", "deploy:s3": "bash scripts/deploy-s3.sh", "postinstall": "husky install", - "codegen:apollo": "apollo client:codegen --target typescript --tsFileExtension=d.ts --outputFlat src/@types/apollo/" + "codegen:apollo": "apollo client:codegen --endpoint=https://subgraphv4.rinkeby.oceanprotocol.com/subgraphs/name/oceanprotocol/ocean-subgraph --target typescript --tsFileExtension=d.ts --outputFlat src/@types/subgraph/" }, "dependencies": { "@coingecko/cryptoformat": "^0.4.4", diff --git a/src/@context/Profile.tsx b/src/@context/Profile.tsx index 2a24cc4b7..4145a83c1 100644 --- a/src/@context/Profile.tsx +++ b/src/@context/Profile.tsx @@ -13,7 +13,7 @@ import { getUserTokenOrders } from '@utils/subgraph' import { useUserPreferences } from './UserPreferences' -import { PoolShares_poolShares as PoolShare } from '../@types/apollo/PoolShares' +import { PoolShares_poolShares as PoolShare } from '../@types/subgraph/PoolShares' import { Asset, LoggerInstance } from '@oceanprotocol/lib' import { getDownloadAssets, getPublishedAssets } from '@utils/aquarius' import { useSiteMetadata } from '@hooks/useSiteMetadata' diff --git a/src/@utils/aquarius.ts b/src/@utils/aquarius.ts index fc06fd3ee..2490506d3 100644 --- a/src/@utils/aquarius.ts +++ b/src/@utils/aquarius.ts @@ -6,7 +6,7 @@ import { import { AssetSelectionAsset } from '@shared/FormFields/AssetSelection' import { PriceList, getAssetsPriceList } from './subgraph' import axios, { CancelToken, AxiosResponse } from 'axios' -import { OrdersData_orders as OrdersData } from '../@types/apollo/OrdersData' +import { OrdersData_orders as OrdersData } from '../@types/subgraph/OrdersData' import { metadataCacheUri } from '../../app.config' import { SortDirectionOptions, diff --git a/src/@utils/subgraph.ts b/src/@utils/subgraph.ts index b724429c6..ffeeb1080 100644 --- a/src/@utils/subgraph.ts +++ b/src/@utils/subgraph.ts @@ -5,26 +5,26 @@ import { getOceanConfig } from './ocean' import { AssetsPoolPrice, AssetsPoolPrice_pools as AssetsPoolPricePool -} from '../@types/apollo/AssetsPoolPrice' +} from '../@types/subgraph/AssetsPoolPrice' import { AssetsFrePrice, AssetsFrePrice_fixedRateExchanges as AssetsFrePriceFixedRateExchange -} from '../@types/apollo/AssetsFrePrice' +} from '../@types/subgraph/AssetsFrePrice' import { AssetsFreePrice, AssetsFreePrice_dispensers as AssetFreePriceDispenser -} from '../@types/apollo/AssetsFreePrice' -import { AssetPreviousOrder } from '../@types/apollo/AssetPreviousOrder' +} from '../@types/subgraph/AssetsFreePrice' +import { AssetPreviousOrder } from '../@types/subgraph/AssetPreviousOrder' import { HighestLiquidityAssets_pools as HighestLiquidityAssetsPool, HighestLiquidityAssets as HighestLiquidityGraphAssets -} from '../@types/apollo/HighestLiquidityAssets' +} from '../@types/subgraph/HighestLiquidityAssets' import { PoolShares as PoolSharesList, PoolShares_poolShares as PoolShare -} from '../@types/apollo/PoolShares' -import { OrdersData_orders as OrdersData } from '../@types/apollo/OrdersData' -import { UserSalesQuery as UsersSalesList } from '../@types/apollo/UserSalesQuery' +} from '../@types/subgraph/PoolShares' +import { OrdersData_orders as OrdersData } from '../@types/subgraph/OrdersData' +import { UserSalesQuery as UsersSalesList } from '../@types/subgraph/UserSalesQuery' export interface UserLiquidity { price: string diff --git a/src/components/@shared/PoolTransactions/index.tsx b/src/components/@shared/PoolTransactions/index.tsx index 57be3759a..1548ba457 100644 --- a/src/components/@shared/PoolTransactions/index.tsx +++ b/src/components/@shared/PoolTransactions/index.tsx @@ -4,7 +4,7 @@ import Table from '@shared/atoms/Table' import AssetTitle from '@shared/AssetList/AssetListTitle' import { useUserPreferences } from '@context/UserPreferences' import { gql } from 'urql' -import { TransactionHistory_poolTransactions as TransactionHistoryPoolTransactions } from '../../../@types/apollo/TransactionHistory' +import { TransactionHistory_poolTransactions as TransactionHistoryPoolTransactions } from '../../../@types/subgraph/TransactionHistory' import web3 from 'web3' import { fetchDataForMultipleChains } from '@utils/subgraph' import { useSiteMetadata } from '@hooks/useSiteMetadata' diff --git a/src/components/Asset/AssetActions/Consume.tsx b/src/components/Asset/AssetActions/Consume.tsx index e930fb209..19915f5c8 100644 --- a/src/components/Asset/AssetActions/Consume.tsx +++ b/src/components/Asset/AssetActions/Consume.tsx @@ -6,7 +6,7 @@ import { useSiteMetadata } from '@hooks/useSiteMetadata' import { useAsset } from '@context/Asset' import { gql } from 'urql' import { fetchData, getQueryContext } from '@utils/subgraph' -import { OrdersData } from '../../../@types/apollo/OrdersData' +import { OrdersData } from '../../../@types/subgraph/OrdersData' import BigNumber from 'bignumber.js' import { useWeb3 } from '@context/Web3' import { usePricing } from '@hooks/usePricing' diff --git a/src/components/Asset/AssetActions/Pool/Graph.tsx b/src/components/Asset/AssetActions/Pool/Graph.tsx index 4539334e2..6883b5fa9 100644 --- a/src/components/Asset/AssetActions/Pool/Graph.tsx +++ b/src/components/Asset/AssetActions/Pool/Graph.tsx @@ -17,7 +17,7 @@ import Button from '@shared/atoms/Button' import { LoggerInstance } from '@oceanprotocol/lib' import { useAsset } from '@context/Asset' import { gql, OperationResult } from 'urql' -import { PoolHistory } from '../../../../@types/apollo/PoolHistory' +import { PoolHistory } from '../../../../@types/subgraph/PoolHistory' import { fetchData, getQueryContext } from '@utils/subgraph' import styles from './Graph.module.css' diff --git a/src/components/Asset/AssetActions/Pool/index.tsx b/src/components/Asset/AssetActions/Pool/index.tsx index 2b59242be..97bd22b8a 100644 --- a/src/components/Asset/AssetActions/Pool/index.tsx +++ b/src/components/Asset/AssetActions/Pool/index.tsx @@ -14,7 +14,7 @@ import AssetActionHistoryTable from '../AssetActionHistoryTable' import Graph from './Graph' import { useAsset } from '@context/Asset' import { gql, OperationResult } from 'urql' -import { PoolLiquidity } from '../../../../@types/apollo/PoolLiquidity' +import { PoolLiquidity } from '../../../../@types/subgraph/PoolLiquidity' import { useWeb3 } from '@context/Web3' import PoolTransactions from '@shared/PoolTransactions' import { fetchData, getQueryContext } from '@utils/subgraph' diff --git a/src/components/Asset/AssetContent/EditHistory.tsx b/src/components/Asset/AssetContent/EditHistory.tsx index 4aa982307..b900edcd0 100644 --- a/src/components/Asset/AssetContent/EditHistory.tsx +++ b/src/components/Asset/AssetContent/EditHistory.tsx @@ -3,7 +3,7 @@ import { useAsset } from '@context/Asset' import ExplorerLink from '@shared/ExplorerLink' import Time from '@shared/atoms/Time' import { gql, OperationContext, useQuery } from 'urql' -import { ReceiptData_nftUpdates as ReceiptData } from '../../../@types/apollo/ReceiptData' +import { ReceiptData_nftUpdates as ReceiptData } from '../../../@types/subgraph/ReceiptData' import { getQueryContext } from '@utils/subgraph' import styles from './EditHistory.module.css' diff --git a/src/components/Profile/Header/Stats.tsx b/src/components/Profile/Header/Stats.tsx index d1809739e..f2e41a019 100644 --- a/src/components/Profile/Header/Stats.tsx +++ b/src/components/Profile/Header/Stats.tsx @@ -11,7 +11,7 @@ import Conversion from '@shared/Price/Conversion' import NumberUnit from './NumberUnit' import styles from './Stats.module.css' import { useProfile } from '@context/Profile' -import { PoolShares_poolShares as PoolShare } from '../../../@types/apollo/PoolShares' +import { PoolShares_poolShares as PoolShare } from '../../../@types/subgraph/PoolShares' async function getPoolSharesLiquidity( poolShares: PoolShare[] diff --git a/src/components/Profile/History/PoolShares.tsx b/src/components/Profile/History/PoolShares.tsx index dbdbdabcc..d3787a7bf 100644 --- a/src/components/Profile/History/PoolShares.tsx +++ b/src/components/Profile/History/PoolShares.tsx @@ -3,7 +3,7 @@ import Table from '@shared/atoms/Table' import Conversion from '@shared/Price/Conversion' import styles from './PoolShares.module.css' import AssetTitle from '@shared/AssetList/AssetListTitle' -import { PoolShares_poolShares as PoolShare } from '../../../@types/apollo/PoolShares' +import { PoolShares_poolShares as PoolShare } from '../../../@types/subgraph/PoolShares' import web3 from 'web3' import Token from '../../Asset/AssetActions/Pool/Token' import { calculateUserLiquidity } from '@utils/subgraph'