generate union types instead of enums
This commit is contained in:
@@ -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,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in New Issue
Block a user