Skip to content

Commit

Permalink
feat(cli): disable environment input, rename flag (#731)
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonkuhrt committed Mar 23, 2024
1 parent 48e4d64 commit 4318cac
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/cli/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,21 @@ import { z } from 'zod'
import { generateCode } from '../generator/generator.js'

const args = Command.create().description(`Generate a type safe GraphQL client.`)
.parameter(`schemaPath`, z.string().min(1).describe(`File path to where your GraphQL schema is.`))
.parameter(`schema`, z.string().min(1).describe(`File path to where your GraphQL schema is.`))
.parameter(
`output`,
z.string().min(1).optional().describe(
`File path for where to output the generated TypeScript types. If not given, outputs to stdout.`,
),
)
.settings({
parameters: {
environment: false,
},
})
.parse()

const schemaSource = await fs.readFile(args.schemaPath, `utf8`)
const schemaSource = await fs.readFile(args.schema, `utf8`)
const code = generateCode({ schemaSource })

if (args.output) {
Expand Down

0 comments on commit 4318cac

Please sign in to comment.