File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import { z } from 'zod'
6
6
import { toAbsolutePath } from '../../lib/fsp.js'
7
7
import { isError , urlParseSafe } from '../../lib/prelude.js'
8
8
import { Generator } from '../__.js'
9
- import { type ConfigInit , OutputCase } from '../config/configInit.js'
9
+ import { type ConfigInit , ImportFormat , OutputCase } from '../config/configInit.js'
10
10
11
11
const args = Command . create ( ) . description ( `Generate a type safe GraphQL client.` )
12
12
. parameter (
@@ -57,6 +57,12 @@ const args = Command.create().description(`Generate a type safe GraphQL client.`
57
57
)
58
58
. optional ( ) ,
59
59
)
60
+ . parameter (
61
+ `importFormat` ,
62
+ z . nativeEnum ( ImportFormat ) . default ( `jsExtension` ) . describe (
63
+ `How should import identifiers be generated? For example "tsExtension" would yield modules that import like "import ... from './foo.ts'".` ,
64
+ ) ,
65
+ )
60
66
. settings ( {
61
67
parameters : {
62
68
environment : false ,
@@ -119,6 +125,8 @@ if (args.format !== undefined) input.format = args.format
119
125
if ( args . name !== undefined ) input . name = args . name
120
126
if ( args . output !== undefined ) input . outputDirPath = toAbsolutePath ( process . cwd ( ) , args . output )
121
127
128
+ input . importFormat = args . importFormat
129
+
122
130
// --- Generate ---
123
131
124
132
await Generator . generate ( input )
You can’t perform that action at this time.
0 commit comments