19 lines
494 B
JavaScript
19 lines
494 B
JavaScript
const { exec } = require('child_process');
|
|
|
|
const { URL_CRM_GRAPHQL_DIRECT } = process.env;
|
|
const PATH_CRM_GRAPHQL_SCHEMA = './apps/web/graphql/crm.schema.graphql';
|
|
|
|
const command = ['gql-sdl ', URL_CRM_GRAPHQL_DIRECT, ' ', '-o', PATH_CRM_GRAPHQL_SCHEMA].join('');
|
|
|
|
exec(command, (error, stdout, stderr) => {
|
|
if (error) {
|
|
console.log(`error: ${error.message}`);
|
|
return;
|
|
}
|
|
if (stderr) {
|
|
console.log(`stderr: ${stderr}`);
|
|
return;
|
|
}
|
|
console.log(`stdout: ${stdout}`);
|
|
});
|