typegraphql-prisma icon indicating copy to clipboard operation
typegraphql-prisma copied to clipboard

Fix issue with isolated modules in SWC

Open MateusZitelli opened this issue 3 years ago • 0 comments

Description

When using generated resolvers with TypeScript isolated modules enabled, we get the following error during next build (probably due to swc):

A type referenced in a decorated signature must be imported with 'import type' or a namespace import when 'isolatedModules' and 'emitDecoratorMetadata' are enabled

Because of a full import of GraphQLResolveInfo from graphql.

How it was solved

When using import type, the isolated modules constraint is preserved. This PR changes the imports generator to generate type imports for GraphQL.

MateusZitelli avatar Aug 29 '22 19:08 MateusZitelli