-
-
Notifications
You must be signed in to change notification settings - Fork 23
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
Allow creating schema without source files #35
Comments
@efreila I like the idea, I can start working on something of the sorts, this will likely be a major version upgrade as the typical use-case is going to need to be set-aside so this use-case can be on equal footing. |
@efreila I have a POC up and running, was a lot less than I thought as this was the original functionality of schemix. Will get a PR going. |
@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. |
It looks like there's currently only support for creating a Prisma schema by creating specific folders to hold
mixins
,models
, andenums
. This seems like a great approach for the typical use-case where you want to programmatically create and maintain a project'sschema.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 callingtoString()
on the resultingPrismaModel
s, but it doesn't look like this is possible because there's a check for an existingschema
object here.Has there been any thought given to being able to support such use-cases?
The text was updated successfully, but these errors were encountered: