11import { Auth } from '@/Auth/index.js' ;
2- import { projectOptions , confOptions } from '@/common/promptOptions.js' ;
2+ import { projectOptions , confOptions , ConfOptions } from '@/common/promptOptions.js' ;
33import { Config , ConfigurationOptions } from '@/Configuration/index.js' ;
44import { CommandModule } from 'yargs' ;
55import { CommandSchemaPull } from './pull.js' ;
66import { CommandSchemaPush } from './push.js' ;
77
8+ const schemaOptions : ConfOptions = {
9+ ...projectOptions ,
10+ schemaDir : {
11+ type : 'string' ,
12+ describe : 'location of the schema file'
13+ }
14+ }
15+
816export default {
917 command : 'schema <command>' ,
1018 describe : 'Generate and modify your GraphQL schema' ,
@@ -14,7 +22,7 @@ export default {
1422 'pull' ,
1523 'Generate GraphQL schema from project at given path' ,
1624 async ( yargs ) => {
17- yargs . options ( confOptions ( { ... projectOptions } ) ) ;
25+ yargs . options ( confOptions ( schemaOptions ) ) ;
1826 } ,
1927 async ( argv ) => {
2028 await Auth . login ( ) . then ( Config . setTokenOptions ) ;
@@ -30,7 +38,7 @@ export default {
3038 'push' ,
3139 'Deploy GraphQL schema as latest' ,
3240 async ( yargs ) => {
33- yargs . options ( confOptions ( { ... projectOptions } ) ) ;
41+ yargs . options ( confOptions ( schemaOptions ) ) ;
3442 } ,
3543 async ( argv ) => {
3644 await Auth . login ( ) . then ( Config . setTokenOptions ) ;
0 commit comments