mirror of
https://github.com/zoo-apps/exchange.git
synced 2026-10-30 15:02:24 +00:00
- Full app extraction from zoo monorepo (source only) - Configured for GitHub Pages deployment - Static export enabled - Custom domain: zoo.exchange - Excludes node_modules and build artifacts
24 lines
748 B
JavaScript
24 lines
748 B
JavaScript
/* eslint-env node */
|
|
|
|
require('dotenv').config({ path: '.env.production' })
|
|
|
|
const { exec } = require('child_process')
|
|
const dataConfig = require('./graphql.config')
|
|
const thegraphConfig = require('./graphql_thegraph.config')
|
|
|
|
function fetchSchema(url, outputFile) {
|
|
exec(
|
|
`get-graphql-schema --h Origin=https://app.uniswap.org ${url} | tee ${outputFile}.temp`,
|
|
(error, stdout, stderr) => {
|
|
if (error || stderr) {
|
|
console.log(`Failed to fetch schema from ${url}: ${stderr}`)
|
|
} else if (stdout) {
|
|
exec(`mv ${outputFile}.temp ${outputFile}`)
|
|
}
|
|
}
|
|
)
|
|
}
|
|
|
|
fetchSchema(process.env.THE_GRAPH_SCHEMA_ENDPOINT, thegraphConfig.schema)
|
|
fetchSchema(process.env.REACT_APP_PUBLIC_API_ENDPOINT, dataConfig.schema)
|