typegraphql-prisma
typegraphql-prisma copied to clipboard
Fix issue with isolated modules in SWC
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.