Allow creating schema without source files
See original GitHub issueIt looks like there’s currently only support for creating a Prisma schema by creating specific folders to hold mixins
, models
, and enums
. This seems like a great approach for the typical use-case where you want to programmatically create and maintain a project’s schema.prisma
file.
However, my use-case is a bit different. I’m trying to parse a GraphQL schema and build up a Prisma schema string on-demand. Essentially, I want to be able to independently create Prisma models, enums, and mixins and store them in variables, from which I’ll later be able to create a complete (or partial) Prisma schema string by calling toString()
on all of the objects and doing string concatentation.
I tried to get this to work by importing and using functions like createModel
, createMixin
, etc. and calling toString()
on the resulting PrismaModel
s, but it doesn’t look like this is possible because there’s a check for an existing schema
object here.
Has there been any thought given to being able to support such use-cases?
Issue Analytics
- State:
- Created a year ago
- Comments:5 (4 by maintainers)
Top GitHub Comments
@ridafkih Thanks for opening the PR so quickly! Taking a look at it now and should have it reviewed soon.
@efreila Released in v1.6.0! Let me know if I broke anything with my unit testing & lint configuration changes.