-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support output attribute for the generator #105
Comments
This might bring significant internal complexity, I'd like to see strong use-cases for it first. |
My use-case is a monorepo setup where I would like to keep the prisma files together and not modify the node-modules. If this is not supposed to work, I would suggest to change the console output that indicates the new location. Right now the config does make it at least into the prisma generate console info. |
You're saying that if it cannot be controlled it should not be mentioned in the logging to the user?
So this sounds like a subjective organizing principal which is fine but it would be good to know how, without this feature, what happens in your setup? What breaks? What are the blockers? |
I think a really good way to motivate this would be to start with a PR that changes the docs in such a way as to motivate this, e.g. a recipe for "if you have X problem then set output to Y". |
I have exactly the same usecase as @heddendorp, I want to build everything related to Prisma and Nexus once, and share it among our microservices. |
@dimaip could you share more about what that looks like. How does the db for one microservice translate to another in a useful way? |
@jasonkuhrt my use-case: an API that needs to access 2 different prisma schemas/clients. I don't see any solution other than having the possibility to generate the nexus-prisma files into 2 different locations. Am I wrong? |
@filippodossena-mozart so you have two PSL files in your project modelling two different databases? |
@jasonkuhrt all microservices share the same database/schema/Prisma client in our case. |
@dimaip so there is one PSL file. Thus Prisma Client is being emitted into one place I assume? |
I don't know what's a PSL file. I have one prisma schema file, one emitted Prisma client, that's used from a bunch of different places. I've now ditch nexus-prisma and use Pal.js to connect it to Nexus, so Prisma schema is decoupled from Nexus or |
@jasonkuhrt yes, 2 different prisma schema files. |
@filippodossena-mozart interesting use-case, I think that seals it for me, in that case its essential. |
@jasonkuhrt as a workaround I leveraged the nohoist option of In the monorepo I created 2 packages, each one containing its own PSL file and an // index.ts
export * from "@prisma/client"
export * as NexusPrisma from "nexus-prisma" // `as` is required because prisma and nexus-prisma have some exports with equal names The trick is to use the "workspaces": {
"packages": [
"packages/*"
],
"nohoist": [
"**/@prisma/client",
"**/prisma",
"**/nexus-prisma"
]
}, In this way, In the other packages that need to access the prisma client or the code generated by |
🎉 This issue has been resolved in version 1.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Perceived Problem
The generator does not support the output property of other prisma generators
Ideas / Proposed Solution(s)
Read and respect the output property in the schema definition like
The text was updated successfully, but these errors were encountered: