With the release of [email protected] https://www.prisma.io/blog/datamodel-v11-lrzqy1f56c90
we now get an error when running nexus-prisma-generate:
Warning: The
prisma generatecommand was executed twice. Since Prisma 1.31, the Prisma client is generated automatically after runningprisma deploy. It is not necessary to generate it via apost-deployhook any more, you can therefore remove the hook if you do not need it otherwise.
What's the proper setup for nexus-prisma-generate?
yes that's a weird message, npx prisma deploy doesn't run npx prisma generate if datamodel hasn't changed.
Hey 👋,
You should be able to use nexus-prisma-generate just like before, but you need to remove prisma generate from the post-hooks as it's now run by default
Closing, feel free to re-open if that did not fix your issue 🙂
On prisma 1.34.0 and nexus-prisma 0.3.7, I keep this warning after each deploy with this prisma.yml
prisma.yml
```endpoint: ${env:PRISMA_ENDPOINT}
datamodel: datamodel.graphql
secret: ${env:PRISMA_SECRET}
hooks:
post-deploy:
- npx nexus-prisma-generate --client ./src/generated/prisma-client --output ./src/generated/nexus-prisma
generate:
seed:
import: seed.graphql
```
Console after deploy :
```post-deploy:
npx : 91 installé(s) en 5.452s
Running npx nexus-prisma-generate --client ./src/generated/prisma-client --output ./src/generated/nexus-prisma...
Types generated at ./src/generated/nexus-prisma
Running npx nexus-prisma-generate --client ./src/generated/prisma-client --output ./src/generated/nexus-prisma √
Warning: The prisma generate command was executed twice. Since Prisma 1.31, the Prisma client is generated automatically after running prisma deploy. It is not necessary to
generate it via a post-deploy hook any more, you can therefore remove the hook if you do not need it otherwise.
Generating schema 41ms```
Most helpful comment
On prisma 1.34.0 and nexus-prisma 0.3.7, I keep this warning after each deploy with this prisma.yml
prisma.yml
```endpoint: ${env:PRISMA_ENDPOINT}
datamodel: datamodel.graphql
secret: ${env:PRISMA_SECRET}
hooks:
post-deploy:
- npx nexus-prisma-generate --client ./src/generated/prisma-client --output ./src/generated/nexus-prisma
generate:
output: ../src/generated/prisma-client/
seed:
import: seed.graphql
```
Console after deploy :
```post-deploy:
npx : 91 installé(s) en 5.452s
Running npx nexus-prisma-generate --client ./src/generated/prisma-client --output ./src/generated/nexus-prisma...
Types generated at ./src/generated/nexus-prisma
Running npx nexus-prisma-generate --client ./src/generated/prisma-client --output ./src/generated/nexus-prisma √
Warning: The
prisma generatecommand was executed twice. Since Prisma 1.31, the Prisma client is generated automatically after runningprisma deploy. It is not necessary togenerate it via a
post-deployhook any more, you can therefore remove the hook if you do not need it otherwise.Generating schema 41ms```