Cauen / prisma-generator-pothos-codegen

The fastest way to create a fully customizable CRUD Graphql API from Prisma Schema.
https://www.npmjs.com/package/prisma-generator-pothos-codegen
100 stars 19 forks source link

vite errors from type only imports #76

Open m1212e opened 1 month ago

m1212e commented 1 month ago

Vite throws this error:

SyntaxError: [vite] The requested module '@pothos/core' does not provide an export named 'MutationFieldsShape'

in the generated utils module. I think this is because the type imports are not marked as such, e.g.

import {
    type FieldOptionsFromKind,
    type InputFieldMap,
    type InterfaceParam,
    MutationFieldBuilder,
    type MutationFieldsShape,
    ObjectRef,
    QueryFieldBuilder,
    type QueryFieldsShape,
    type TypeParam
} from '@pothos/core';
import {
    type PrismaFieldOptions,
    type PrismaObjectTypeOptions,
    type RelatedFieldOptions
} from '@pothos/plugin-prisma';

instead of the current

import {
    FieldOptionsFromKind,
    InputFieldMap,
    InterfaceParam,
    MutationFieldBuilder,
    MutationFieldsShape,
    ObjectRef,
    QueryFieldBuilder,
    QueryFieldsShape,
    TypeParam
} from '@pothos/core';
import {
    PrismaFieldOptions,
    PrismaObjectTypeOptions,
    RelatedFieldOptions
} from '@pothos/plugin-prisma';

Would it be possible to adjust this?