Skip to content

Commit

Permalink
catch missing subgraph URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
auryn-macmillan committed Jul 20, 2022
1 parent 935bbe1 commit 5d4f288
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
1 change: 0 additions & 1 deletion .github/workflows/dev-cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ on:
env:
REACT_APP_POSTER_CONTRACT: ${{ secrets.REACT_APP_POSTER_CONTRACT }}
REACT_APP_INFURA_KEY: ${{ secrets.REACT_APP_INFURA_KEY }}
REACT_APP_SUBGRAPHS: ${{ secrets.REACT_APP_SUBGRAPHS_DEV }}
REACT_APP_SUBGRAPH_BASE_URL: https://api.thegraph.com/subgraphs/name/
REACT_APP_SUBGRAPH_RINKEBY: auryn-macmillan/tabula-rinkeby
REACT_APP_SUBGRAPH_GNOSIS_CHAIN: auryn-macmillan/tabula-gnosis-chain
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/prod-release-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ on:
env:
REACT_APP_POSTER_CONTRACT: ${{ secrets.REACT_APP_POSTER_CONTRACT }}
REACT_APP_INFURA_KEY: ${{ secrets.REACT_APP_INFURA_KEY }}
REACT_APP_SUBGRAPHS: ${{ secrets.REACT_APP_SUBGRAPHS_PROD }}
REACT_APP_SUBGRAPH_BASE_URL: https://api.thegraph.com/subgraphs/name/
REACT_APP_SUBGRAPH_RINKEBY: auryn-macmillan/tabula-dev
REACT_APP_SUBGRAPH_GNOSIS_CHAIN: auryn-macmillan/tabula-gnosis-chain
Expand Down
4 changes: 4 additions & 0 deletions packages/app/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@ REACT_APP_SUBGRAPH_BASE_URL=https://api.thegraph.com/subgraphs/name/
REACT_APP_SUBGRAPH_RINKEBY=auryn-macmillan/tabula-rinkeby
REACT_APP_SUBGRAPH_GNOSIS_CHAIN=auryn-macmillan/tabula-gnosis-chain
REACT_APP_SUBGRAPH_MAINNET=auryn-macmillan/tabula-mainnet
REACT_APP_SUBGRAPH_GOERLI=auryn-macmillan/tabula-goerli
REACT_APP_SUBGRAPH_POLYGON=auryn-macmillan/tabula-polygon
REACT_APP_SUBGRAPH_ARBITRUM=auryn-macmillan/tabula-arbitrum
REACT_APP_SUBGRAPH_OPTIMISM=auryn-macmillan/tabula-optimism
12 changes: 12 additions & 0 deletions packages/app/src/services/graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@ if (!process.env.REACT_APP_SUBGRAPH_RINKEBY) {
if (!process.env.REACT_APP_SUBGRAPH_MAINNET) {
throw new Error("REACT_APP_SUBGRAPH_MAINNET is not set")
}
if (!process.env.REACT_APP_SUBGRAPH_GOERLI) {
throw new Error("REACT_APP_SUBGRAPH_GOERLI is not set")
}
if (!process.env.REACT_APP_SUBGRAPH_POLYGON) {
throw new Error("REACT_APP_SUBGRAPH_POLYGON is not set")
}
if (!process.env.REACT_APP_SUBGRAPH_ARBITRUM) {
throw new Error("REACT_APP_SUBGRAPH_ARBITRUM is not set")
}
if (!process.env.REACT_APP_SUBGRAPH_OPTIMISM) {
throw new Error("REACT_APP_SUBGRAPH_OPTIMISM is not set")
}

const BASE_SUBGRAPH_URL = process.env.REACT_APP_SUBGRAPH_BASE_URL
const SUBGRAPH_GNOSIS_CHAIN = process.env.REACT_APP_SUBGRAPH_GNOSIS_CHAIN
Expand Down

0 comments on commit 5d4f288

Please sign in to comment.