Skip to content

Commit e9ca3c1

Browse files
committed
[TS] Added outputGlobalTypes option to specify path for global types
1 parent 99b435a commit e9ca3c1

7 files changed

Lines changed: 306 additions & 123 deletions

File tree

packages/apollo-cli/src/commands/codegen/__tests__/__snapshots__/generate.test.ts.snap

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,41 @@ export type SimpleQuery = {
575575
//=============================================================="
576576
`;
577577

578+
exports[`successful codegen writes TypeScript global types to a custom path when globalTypesFile is set 1`] = `
579+
"/* tslint:disable */
580+
// This file was automatically generated and should not be edited.
581+
582+
import { SomeEnum } from \\"./../../__foo__/bar\\";
583+
584+
// ====================================================
585+
// GraphQL query operation: SimpleQuery
586+
// ====================================================
587+
588+
export interface SimpleQuery {
589+
someEnum: SomeEnum;
590+
}
591+
"
592+
`;
593+
594+
exports[`successful codegen writes TypeScript global types to a custom path when globalTypesFile is set 2`] = `
595+
"/* tslint:disable */
596+
// This file was automatically generated and should not be edited.
597+
598+
//==============================================================
599+
// START Enums and Input Objects
600+
//==============================================================
601+
602+
export enum SomeEnum {
603+
bar = \\"bar\\",
604+
foo = \\"foo\\",
605+
}
606+
607+
//==============================================================
608+
// END Enums and Input Objects
609+
//==============================================================
610+
"
611+
`;
612+
578613
exports[`successful codegen writes TypeScript types into a __generated__ directory next to sources when no output is set 1`] = `
579614
"/* tslint:disable */
580615
// This file was automatically generated and should not be edited.

0 commit comments

Comments
 (0)