2023-02-28 09:46:31 +03:00

19 lines
558 B
JavaScript

const run = require('tools/scripts');
function downloadSchema() {
const { URL_CRM_GRAPHQL_DIRECT } = process.env;
const PATH_CRM_GRAPHQL_SCHEMA = './graphql/crm.schema.graphql';
const command1 = ['gql-sdl', URL_CRM_GRAPHQL_DIRECT, '-o', PATH_CRM_GRAPHQL_SCHEMA].join(' ');
run(command1, 'Download GraphQL Schema...');
}
function generateTypescript() {
const command2 = ['graphql-codegen,', '--config', '.graphqlrc.yml'].join(' ');
run(command2, 'Generating TypeScript code...');
}
module.exports = {
downloadSchema,
generateTypescript,
};