diff --git a/packages/core/utils/src/graphql/__tests__/gql-schema-to-types.spec.ts b/packages/core/utils/src/graphql/__tests__/gql-schema-to-types.spec.ts index bd436aed26..cc4b7c849a 100644 --- a/packages/core/utils/src/graphql/__tests__/gql-schema-to-types.spec.ts +++ b/packages/core/utils/src/graphql/__tests__/gql-schema-to-types.spec.ts @@ -44,10 +44,7 @@ describe("gqlSchemaToTypes", () => { Float: { input: number; output: number; } }; - export enum Test { - TestA = 'test-a', - TestB = 'Test_B' - } + export type Test = | 'test-a' | 'Test_B'; declare module '@medusajs/framework/types' { interface RemoteQueryEntryPoints { diff --git a/packages/core/utils/src/graphql/graphql-to-ts-types.ts b/packages/core/utils/src/graphql/graphql-to-ts-types.ts index 3645b9bca7..552b47f86e 100644 --- a/packages/core/utils/src/graphql/graphql-to-ts-types.ts +++ b/packages/core/utils/src/graphql/graphql-to-ts-types.ts @@ -157,6 +157,7 @@ export async function gqlSchemaToTypes({ { typescript: { enumValues: getEnumValues(schema), + enumsAsTypes: true, }, }, ],