UNPKG

@graphql-cli/init

Version:

Creates a GraphQL project using a template or GraphQL Config file for your existing project.

23 lines 891 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.fromScratch = void 0; const path_1 = require("path"); const inquirer_1 = require("inquirer"); const create_graphback_1 = require("create-graphback"); async function fromScratch({ context, templateName, templateUrl, }) { if (!context.name) { const { projectName: enteredName } = await inquirer_1.prompt([ { type: 'input', name: 'projectName', message: 'What is the name of the project?', default: 'my-graphql-project', }, ]); context.name = enteredName; context.path = path_1.join(process.cwd(), context.name); } await create_graphback_1.handler({ name: context.name, templateName, templateUrl }); } exports.fromScratch = fromScratch; //# sourceMappingURL=from-scratch.js.map