You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I am somehow confused. The docs say that the nexus-prisma-plugin will:
Workflow integration
Nexus build and dev workflows are enhanced to run your Prisma generators.
Example
Given a Prisma schema (left), you will be able to project these Prisma models onto your API (Nexus Schema) and expose operations against them (middle) resulting in the GraphQL Schema (right).
Prisma Schema: I understand this can be done manually or automatically by prisma - introspection
generator prisma_client {
provider = "prisma-client-js"
}
// prisma model
model User {
id String @id@default(cuid())
email String @unique
birthDate DateTime
}
model Post {
id String @id@default(cuid())
author User[]
}
Nexus Schema: - THIS IS MY QUESTION: Will this be created automatically with nexus dev / build OR this has to be created manually? Could you please provide guidelines on this
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I am somehow confused. The docs say that the nexus-prisma-plugin will:
Workflow integration
Nexus build and dev workflows are enhanced to run your Prisma generators.
Example
Given a Prisma schema (left), you will be able to project these Prisma models onto your API (Nexus Schema) and expose operations against them (middle) resulting in the GraphQL Schema (right).
Prisma Schema: I understand this can be done manually or automatically by prisma - introspection
generator prisma_client {
provider = "prisma-client-js"
}
// prisma model
model User {
id String @id @default(cuid())
email String @unique
birthDate DateTime
}
model Post {
id String @id @default(cuid())
author User[]
}
Nexus Schema: - THIS IS MY QUESTION: Will this be created automatically with nexus dev / build OR this has to be created manually? Could you please provide guidelines on this
import { schema } from 'nexus'
schema.queryType({
definition(t) {
t.crud.user()
t.crud.users({
ordering: true,
})
t.crud.post()
t.crud.posts({
filtering: true,
})
},
})
etc, etc.
Graphql Schema: This is created automatically - OR SDL - better said.
type User {
birthDate: DateTime!
email: String!
id: ID!
posts(after: String, before: String, first: Int, last: Int): [Post!]!
}
I did something but it is not creating the Nexus - schema.
Steps:
-It does not create the Nexus Schema neither the SDL / Graphql Schema
What am I doing wrong? or Definitely I MUST create the Nexus Schema manually.
Thanks in advance,
JA
Beta Was this translation helpful? Give feedback.
All reactions