Skip to content

Commit b4a6fb1

Browse files
authored
Assume the output is a directory when it has no extension (#490)
1 parent 4f31fd8 commit b4a6fb1

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

packages/apollo-cli/src/generate.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ export default function generate(
4747

4848
validateQueryDocument(schema, document);
4949

50+
if (outputPath.split('.').length <= 1 && !fs.existsSync(outputPath)) {
51+
fs.mkdirSync(outputPath);
52+
}
53+
5054
if (target === "swift") {
5155
options.addTypename = true;
5256
const context = compileToIR(schema, document, options);

0 commit comments

Comments
 (0)