Nx: [Feature Request] Prisma

Created on 5 Oct 2019  路  3Comments  路  Source: nrwl/nx

Hey 馃憢 . I've been tracking Nx with interest for a little while as a possible Lerna successor for a larger project I'm involved with. I'm starting a new side project involving Next, Node, and Prisma, and thought about giving this a try and understanding how it all fits together through the CI pipeline and deployment as a learning exercise. I'm doing that here (no promises on that repo, though! 馃 ).

I'd like to make a request to add Prisma as a capability. Thinking through what this might look like a little:

  • Running the Prisma Server/Connecting it to a DB
  • Publishing schema updates
  • Syncing generated GraphQL types
  • Syncing generated my-prisma-app's client (generated in .ts, for example)
  • Support for cli commands like seed, playground, export, import, etc (see more here)

Given you already have support for web components too (馃帀)... I'd be a happy camper!

Unsure if this is in your wheelhouse already, but I couldn't find any other issues around Prisma or guidance around adding a new capability (certainly could have missed it). If I'm running into this need, chances are, others are too, so I wanted to open an issue because of that.

Thanks for the consideration!

node feature

Most helpful comment

Seeing as Prisma 2 launched and is getting huge community adoption, I'd like to bump this. I'm also going to log a issue with the prisma team to see if they can write a nx plugin and maintain it as prisma evolves.

Seeing as prisma is now more of an ORM than a framework and the graphql side of things are not part of prisma itself but @nexus/schema I'd like to also request a plugin for that (or a option to configure the prisma server setup in the plugin).

Just like in @nrwl/react one can choose whether to use sass, styled-components, emotion etc by specifying the --style flag I'd like to be able to specify --server="apollo-express" --graphql-schema="nexus" or similar. Nexus schema can run with apollo server or graphqljs or many other servers under the hood and apollo can run with express/koa/hapi etc. Best would be to default to nexus,apollo,express but config is key to cater for the broader community.

The prisma plugin should setup a schema when booted up and preconfigrue the prisma generate, studio and migrate commands and spin up a test folder using jest etc.

All 3 comments

@ZempTime Hi, thanks for your interest in Nx!

Prisma isn't on our roadmap right now. If you want to help out that would be awesome!

For now, you can even create the setup using @nrwl/workspace:run-commands builder.

e.g.

    "myapp": {
      ...
      "architect": {
        "seed": {
          "builder": "@nrwl/workspace:run-commands",
          "options": {
            "commands": [{ "command": "echo Running the seed command!" }]
          }
        },
        ...

This will allow you to run nx run myapp:seed command. You can swap out echo with any shell command you want.

Hi, sorry about this.

This was mislabeled as stale. We are testing ways to mark _not reproducible_ issues as stale so that we can focus on actionable items but our initial experiment was too broad and unintentionally labeled this issue as stale.

Seeing as Prisma 2 launched and is getting huge community adoption, I'd like to bump this. I'm also going to log a issue with the prisma team to see if they can write a nx plugin and maintain it as prisma evolves.

Seeing as prisma is now more of an ORM than a framework and the graphql side of things are not part of prisma itself but @nexus/schema I'd like to also request a plugin for that (or a option to configure the prisma server setup in the plugin).

Just like in @nrwl/react one can choose whether to use sass, styled-components, emotion etc by specifying the --style flag I'd like to be able to specify --server="apollo-express" --graphql-schema="nexus" or similar. Nexus schema can run with apollo server or graphqljs or many other servers under the hood and apollo can run with express/koa/hapi etc. Best would be to default to nexus,apollo,express but config is key to cater for the broader community.

The prisma plugin should setup a schema when booted up and preconfigrue the prisma generate, studio and migrate commands and spin up a test folder using jest etc.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

olakara picture olakara  路  3Comments

SWGeekPD picture SWGeekPD  路  3Comments

zpydee picture zpydee  路  3Comments

about-code picture about-code  路  3Comments

jon301 picture jon301  路  3Comments