You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Support multiple noun-and-verb APIs within a mono-repo
The Problem
Typical use of the prisma client is via importing @prisma/client.
Within a monorepo, this is hoisted to the mono-repo's node_modules. @prisma/client in turn uses a hard coded ./node_modules/.prisma/client to access the generated client-js.
If the mono-repo contains multiple APIs, this results in each prisma generate overwriting the previous API.
Consequently, only the last API generated is actually available for use.
The Solution
To prevent this, we need two things:
1. Configure output in the prisma client generator:
Support multiple
noun-and-verb
APIs within a mono-repoThe Problem
Typical use of the prisma client is via importing
@prisma/client
.Within a monorepo, this is hoisted to the mono-repo's
node_modules
.@prisma/client
in turn uses a hard coded./node_modules/.prisma/client
to access the generated client-js.If the mono-repo contains multiple APIs, this results in each
prisma generate
overwriting the previous API.Consequently, only the last API generated is actually available for use.
The Solution
To prevent this, we need two things:
1. Configure
output
in the prisma client generator:2. Fix the import
@prisma/client
->.prisma/client
Summary
For this reason, Noun & Verb generated code deviates from official prisma documentation.
The text was updated successfully, but these errors were encountered: