prisma / prisma1

💾 Database Tools incl. ORM, Migrations and Admin UI (Postgres, MySQL & MongoDB) [deprecated]
https://v1.prisma.io/docs/
Apache License 2.0
16.53k stars 861 forks source link

Support relative imports in inline code / CLI #588

Closed joarwilk closed 6 years ago

joarwilk commented 7 years ago

This feature request applies to the CLI workflow mainly

What feature are you missing?

Being able to import another javascript file in my schema extensions / SSRs / pipeline functions.

How could this feature look like in detail? Tradeoffs? Basic use case: I wish to make a certain logic-heavy operation in a schema extension. This logic is shared by other schema extensions. Right now there is no way to share code between extensions, since calling require on a local file will fail in validation/deploy.

A solution would probably be to make the CLI perform some basic bundling of code in the deploy step.

kbrandwijk commented 7 years ago

It's actually really simple, here is a working implementation (taken from webtask-bundle). Does babel + requires, so would fix the ES7 feature demand as well.

https://github.com/auth0/webtask-bundle/tree/master/lib

marktani commented 6 years ago

This issue has been moved to graphcool/graphcool-framework.