uniswap-interface-uncensored/scripts/fetch-schema.js
ButterflyEffect 1c131ee496
Some checks are pending
Crowdin Upload / upload-sources (push) Waiting to run
Test / lint (push) Waiting to run
Test / typecheck (push) Waiting to run
Test / deps-tests (push) Waiting to run
Test / unit-tests (push) Waiting to run
Test / build (push) Waiting to run
Test / cypress-typecheck (push) Waiting to run
Test / cypress-rerun (push) Waiting to run
Test / cypress-test-matrix (1) (push) Blocked by required conditions
Test / cypress-test-matrix (2) (push) Blocked by required conditions
Test / cypress-test-matrix (3) (push) Blocked by required conditions
Test / cypress-test-matrix (4) (push) Blocked by required conditions
Test / hardhat-cache (push) Blocked by required conditions
Test / cloud-typecheck (push) Waiting to run
Test / cloud-tests (push) Waiting to run
Test / pre (push) Waiting to run
Test / post (push) Blocked by required conditions
fix installation graphql script
2023-12-19 13:56:52 +00:00

23 lines
790 B
JavaScript

/* eslint-env node */
require('dotenv').config({ path: '.env.production' })
const child_process = require('child_process')
const fs = require('fs/promises')
const { promisify } = require('util')
const dataConfig = require('../graphql.data.config')
const thegraphConfig = require('../graphql.thegraph.config')
const exec = promisify(child_process.exec)
async function fetchSchema(url, outputFile) {
try {
const { stdout } = await exec(`yarn --silent get-graphql-schema --h Origin=https://app.uniswap.org ${url}`);
await fs.writeFile(outputFile, stdout);
} catch(err){
console.error(`Failed to fetch schema from ${url}`)
}
}
fetchSchema(process.env.THE_GRAPH_SCHEMA_ENDPOINT, thegraphConfig.schema)
fetchSchema(process.env.REACT_APP_AWS_API_ENDPOINT, dataConfig.schema)