paljs / prisma-tools

Prisma tools to help you generate CRUD system for GraphQL servers
https://paljs.com
MIT License
680 stars 55 forks source link

@paljs/nexus : NEXUS__UNKNOWN__TYPE was already defined when updating to prisma 4.0.0 #273

Closed mohammed-bahumaish closed 1 year ago

mohammed-bahumaish commented 2 years ago

I'm using nexus plugin for input types in a nexus Graphql server. but when updating to Prisma 4 I got this error NEXUS__UNKNOWN__TYPE was already defined when . when rolling back to Prisma 3.5 it works fine.

AhmedElywa commented 2 years ago

I am working on that now to update prisma version to prisma 4 and fix all breaking changes

MitchellMonaghan commented 1 year ago

Is there any progress update on this?

simonjoom commented 1 year ago

need to use the last prisma 3.15 because the one used by paljs prisma@3.16 for node 14 seems buggy

amitozalvo commented 1 year ago

I was able to fix this issue by manually generating DMMF when the app starts import { getDMMF, getSchema } from '@prisma/internals'; const dmmf = await getDMMF({ datamodel: await getSchema() })

And providing the DMMF to the paljs plugin when calling makeSchema plugins: [paljs({ dmmf: [dmmf] })]

AhmedElywa commented 1 year ago

This issue request is in #284