Skip to content

Commit f7dda86

Browse files
committedMay 11, 2022
Enable JS output
1 parent 5d0991b commit f7dda86

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed
 

‎.changeset/rotten-ghosts-listen.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@graphql-mesh/cli': minor
3+
---
4+
5+
Enable JS output

‎packages/cli/src/index.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -304,13 +304,13 @@ export async function graphqlMesh(cliParams = DEFAULT_CLI_PARAMS, args = hideBin
304304
}
305305
}
306306
)
307-
.command<{ fileType: 'json' | 'ts' }>(
307+
.command<{ fileType: 'json' | 'ts' | 'js' }>(
308308
cliParams.buildArtifactsCommand,
309309
'Builds artifacts',
310310
builder => {
311311
builder.option('fileType', {
312312
type: 'string',
313-
choices: ['json', 'ts'],
313+
choices: ['json', 'ts', 'js'],
314314
default: 'ts',
315315
});
316316
},
@@ -347,7 +347,7 @@ export async function graphqlMesh(cliParams = DEFAULT_CLI_PARAMS, args = hideBin
347347
new FsStoreStorageAdapter({
348348
cwd: baseDir,
349349
importFn,
350-
fileType: args.fileType,
350+
fileType: args.fileType === 'js' ? 'json' : args.fileType,
351351
}),
352352
{
353353
readonly: false,
@@ -384,7 +384,7 @@ export async function graphqlMesh(cliParams = DEFAULT_CLI_PARAMS, args = hideBin
384384
meshConfigCode: meshConfig.code,
385385
logger,
386386
sdkConfig: meshConfig.config.sdk,
387-
tsOnly: true,
387+
tsOnly: args.fileType !== 'js',
388388
codegenConfig: meshConfig.config.codegen,
389389
},
390390
cliParams

1 commit comments

Comments
 (1)
Please sign in to comment.