File tree 1 file changed +7
-13
lines changed
1 file changed +7
-13
lines changed Original file line number Diff line number Diff line change @@ -9,19 +9,13 @@ const thegraphConfig = require('../graphql.thegraph.config')
9
9
10
10
const exec = promisify ( child_process . exec )
11
11
12
- function fetchSchema ( url , outputFile ) {
13
- exec ( `yarn --silent get-graphql-schema --h Origin=https://app.uniswap.org ${ url } ` )
14
- . then ( ( { stderr, stdout } ) => {
15
- if ( stderr ) {
16
- throw new Error ( stderr )
17
- } else {
18
- fs . writeFile ( outputFile , stdout )
19
- }
20
- } )
21
- . catch ( ( err ) => {
22
- console . error ( err )
23
- console . error ( `Failed to fetch schema from ${ url } ` )
24
- } )
12
+ async function fetchSchema ( url , outputFile ) {
13
+ try {
14
+ const { stdout } = await exec ( `yarn --silent get-graphql-schema --h Origin=https://app.uniswap.org ${ url } ` ) ;
15
+ await fs . writeFile ( outputFile , stdout ) ;
16
+ } catch ( err ) {
17
+ console . error ( `Failed to fetch schema from ${ url } ` )
18
+ }
25
19
}
26
20
27
21
fetchSchema ( process . env . THE_GRAPH_SCHEMA_ENDPOINT , thegraphConfig . schema )
You can’t perform that action at this time.
0 commit comments