Published on

How to Fix spawnSync graphql ENOENT in Prisma

Authors

I was playing around with prisma and had an issue in the post-deploy

endpoint: ${env:PRISMA_ENDPOINT}
datamodel: datamodel.prisma
# secret: ${env:PRISMA_SECRET}
hooks:
  post-deploy:
    - graphql get-schema -p prisma

Basically, I was generating schema after the Prisma is deployed using post-deploy hooks.

It turns out the reason for the issue is because I didn't have graphql-cli installed on my machine globally.

Just after installing that package. The above issue got resolved.

npm i -g graphql-cli