a7c6ce499d
* build: use fewer babel versions * build: dedup * test: test deps dedups * fix: test.yml * fix: typo * test: failing * fix: dedup * fix: dedup * test: comment dedup tests * chore: whitespace * test: package size * build: scripts * test: update test-size * docs: CONTRIBUTING
24 lines
736 B
JavaScript
24 lines
736 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}`)
|
|
} else if (stdout) {
|
|
exec(`mv ${outputFile}.temp ${outputFile}`)
|
|
}
|
|
}
|
|
)
|
|
}
|
|
|
|
fetchSchema(process.env.THE_GRAPH_SCHEMA_ENDPOINT, thegraphConfig.schema)
|
|
fetchSchema(process.env.REACT_APP_AWS_API_ENDPOINT, dataConfig.schema)
|