Skip to content

Commit 4318cac

Browse files
authored
feat(cli): disable environment input, rename flag (#731)
1 parent 48e4d64 commit 4318cac

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/cli/generate.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,21 @@ import { z } from 'zod'
66
import { generateCode } from '../generator/generator.js'
77

88
const args = Command.create().description(`Generate a type safe GraphQL client.`)
9-
.parameter(`schemaPath`, z.string().min(1).describe(`File path to where your GraphQL schema is.`))
9+
.parameter(`schema`, z.string().min(1).describe(`File path to where your GraphQL schema is.`))
1010
.parameter(
1111
`output`,
1212
z.string().min(1).optional().describe(
1313
`File path for where to output the generated TypeScript types. If not given, outputs to stdout.`,
1414
),
1515
)
16+
.settings({
17+
parameters: {
18+
environment: false,
19+
},
20+
})
1621
.parse()
1722

18-
const schemaSource = await fs.readFile(args.schemaPath, `utf8`)
23+
const schemaSource = await fs.readFile(args.schema, `utf8`)
1924
const code = generateCode({ schemaSource })
2025

2126
if (args.output) {

0 commit comments

Comments
 (0)