<@U0MQEEY4V> Around <https://github.com/prisma/pri...
# orm-help
k
@schickling Around https://github.com/prisma/prisma-examples/tree/master/typescript-graphql, There is some weird thing,
prisma seed
use a
seed.ts
which use generated prisma client. In the case you don't have generated files yet, you're just not being able to perform the first deploy. Everything works with repo as
generated
folder is already here when pulling. But IMO
generated
folder must be git ignored.
s
Hmm good point. I think there’s a bug where the
run
seed option should be always relative to the
prisma.yml
file but currently is relative to your cwd of your CLI. Would you mind opening a GH issue for this? 🙏
k
Hm, I might have not been clear, the issue is that the
seed.ts
depends on generated resources. And generation is done AFTER deploy, so AFTER seeding. So even if you keep your
generated
folder, seeding will always use a version generated with the old schema 😁
Even if seeding is trigger once, there is 2 cases that will throw an error : 1) Pull the example, remove
generated
folder, then
prisma deploy
2) Pull the example, change
datamodel.prisma
to have a new Model, change
seed.ts
to add some entries related to this Model,
prisma deploy
(in this case you'll even have
typescript
errors in your VSCode Editor when updating
seed.ts
^^
s
Oh, that’s a very good point. Would you mind opening an issue for this in the examples repo then? 🙂
k
Yes I'll open an issue in few hours (can't do it now)
BUT @schickling I don't really know what to put inside the issue ahah, as there is no solution to it, if we want to use Prisma Client to seed, types need to be already generated. But they can't be generated before seeding as it's generated afer deploy.
s
The issue is a first great start. We’ll push things forward from there! 💪