P
Prisma•2mo ago
Jack Delamou

generated type

Hei guys. Can someone explain to me how i can access my schema model generated type( PostCreateInput). This is how im importing PrismaClient and Prisma object: import { PrismaClient, Prisma } from "../../prisma/generated/client"; This other way of importing PrismaClient is not working for me. import { PrismaClient } from "@prisma/client"; Im using Prisma Postgres db with Accelerate
4 Replies
Prisma AI Help
Prisma AI Help•2mo ago
You decided to hold for human wisdom. We'll chime in soon! Meanwhile, #ask-ai is there if you need a quick second opinion.
Nurul
Nurul•2mo ago
To access your schema model's generated type, such as PostCreateInput, you should import the Prisma namespace from your generated client output path, not from @prisma/client if you are using a custom output path.
import { PrismaClient, Prisma } from "../../prisma/generated/client";

const prisma = new PrismaClient();

const input: Prisma.PostCreateInput = {
// ...
};
import { PrismaClient, Prisma } from "../../prisma/generated/client";

const prisma = new PrismaClient();

const input: Prisma.PostCreateInput = {
// ...
};
Jack Delamou
Jack DelamouOP•2mo ago
Thanks alot
Nurul
Nurul•2mo ago
No worries! 🙂

Did you find this page helpful?