-
-
Notifications
You must be signed in to change notification settings - Fork 110
/
prompts.js
67 lines (67 loc) · 1.89 KB
/
prompts.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
module.exports = [
{
type: 'confirm',
name: 'addExamples',
message: 'Add example code',
description: 'This will generate a component, graphql files and an example schema (if server is added).',
default: false,
},
{
type: 'confirm',
name: 'addServer',
message: 'Add a GraphQL API Server?',
description: 'Generate GraphQL server files in a `apollo-server` folder.',
group: 'GraphQL Server',
default: false,
},
{
type: 'confirm',
name: 'addMocking',
message: 'Enable automatic mocking?',
description: 'Missing resolvers will be automatically mocked.',
group: 'GraphQL Server',
default: false,
when: answers => answers.addServer,
},
{
type: 'confirm',
name: 'addApolloEngine',
message: 'Configure Apollo Engine?',
link: 'http://engine.apollographql.com/',
group: 'GraphQL Server',
default: false,
},
{
type: 'input',
name: 'apolloEngineService',
message: 'Apollo Service ID (create one at https://engine.apollographql.com):',
group: 'GraphQL Server',
validate: input => !!input,
when: answers => answers.addApolloEngine,
},
{
type: 'input',
name: 'apolloEngineKey',
message: 'API Key:',
description: 'It should look like this: \'service:name-xxxx:xxxxxxxxxxxxxxxxxxxxxx\'',
group: 'GraphQL Server',
validate: input => !!input,
when: answers => answers.addApolloEngine,
},
{
type: 'input',
name: 'apolloEngineTag',
message: 'Default Schema Tag:',
description: 'You can have data over multiples tags, which is useful when having several env like staging and production.',
group: 'GraphQL Server',
when: answers => answers.addApolloEngine,
},
{
type: 'confirm',
name: 'publishSchema',
message: 'Publish schema on Apollo Engine?',
group: 'GraphQL Server',
default: false,
when: answers => answers.addApolloEngine,
},
]