-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sdlInputs not working because of changes in prisma. #283
Comments
I temporarily solved by manually generating the dmmf with this function (you can automate this to happen before nexus generation with a script command in import { getDMMF } from "@prisma/internals"
import fs from "fs"
const run = async () => {
const schema = fs.readFileSync(`${__dirname}/../../../prisma/schema.prisma`, {
encoding: "utf-8",
})
const dmmf = await getDMMF({ datamodel: schema })
fs.writeFileSync(`${__dirname}/dmmf.json`, JSON.stringify(dmmf, null, 2))
}
run() and then passing the result to the paljs plugin settings: // This file was generated from the previous step
import dmmfJSON from "./dmmf.json"
const nexusSchema = makeSchema({
types: myGeneratedTypes,
plugins: [
paljs({
dmmf: [JSON.parse(JSON.stringify(dmmfJSON))],
}),
],
outputs: {
...
},
contextType: {
...
},
}) This is just a temporary fix while hopefully paljs gets upgraded. |
This issue request is in #284 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The "sdlInputs.ts" is not working because of changes in prisma 4.
As pointed here, Prisma no longer exports Prisma.dmmf.schema into the generated Prisma Client.
I don't know if it helps, but the new getDMMF function can be imported with:
import { getDMMF } from "@prisma/internals/dist/engine-commands";
I thought about making a pull request, but as getDMMF is an asynchronous function, I don't know the best way to solve the problem.
The text was updated successfully, but these errors were encountered: