1
1
import { Auth } from '@/Auth/index.js' ;
2
- import { projectOptions , confOptions } from '@/common/promptOptions.js' ;
2
+ import { projectOptions , confOptions , ConfOptions } from '@/common/promptOptions.js' ;
3
3
import { Config , ConfigurationOptions } from '@/Configuration/index.js' ;
4
4
import { CommandModule } from 'yargs' ;
5
5
import { CommandSchemaPull } from './pull.js' ;
6
6
import { CommandSchemaPush } from './push.js' ;
7
7
8
+ const schemaOptions : ConfOptions = {
9
+ ...projectOptions ,
10
+ schemaDir : {
11
+ type : 'string' ,
12
+ describe : 'location of the schema file'
13
+ }
14
+ }
15
+
8
16
export default {
9
17
command : 'schema <command>' ,
10
18
describe : 'Generate and modify your GraphQL schema' ,
@@ -14,7 +22,7 @@ export default {
14
22
'pull' ,
15
23
'Generate GraphQL schema from project at given path' ,
16
24
async ( yargs ) => {
17
- yargs . options ( confOptions ( { ... projectOptions } ) ) ;
25
+ yargs . options ( confOptions ( schemaOptions ) ) ;
18
26
} ,
19
27
async ( argv ) => {
20
28
await Auth . login ( ) . then ( Config . setTokenOptions ) ;
@@ -30,7 +38,7 @@ export default {
30
38
'push' ,
31
39
'Deploy GraphQL schema as latest' ,
32
40
async ( yargs ) => {
33
- yargs . options ( confOptions ( { ... projectOptions } ) ) ;
41
+ yargs . options ( confOptions ( schemaOptions ) ) ;
34
42
} ,
35
43
async ( argv ) => {
36
44
await Auth . login ( ) . then ( Config . setTokenOptions ) ;
0 commit comments