generate union types instead of enums

This commit is contained in:
Pedro Guzman
2025-06-13 12:23:58 +02:00
parent 4e9d2352f8
commit 8e3490d748
2 changed files with 2 additions and 4 deletions
@@ -44,10 +44,7 @@ describe("gqlSchemaToTypes", () => {
Float: { input: number; output: number; } Float: { input: number; output: number; }
}; };
export enum Test { export type Test = | 'test-a' | 'Test_B';
TestA = 'test-a',
TestB = 'Test_B'
}
declare module '@medusajs/framework/types' { declare module '@medusajs/framework/types' {
interface RemoteQueryEntryPoints { interface RemoteQueryEntryPoints {
@@ -157,6 +157,7 @@ export async function gqlSchemaToTypes({
{ {
typescript: { typescript: {
enumValues: getEnumValues(schema), enumValues: getEnumValues(schema),
enumsAsTypes: true,
}, },
}, },
], ],