Replies: 1 comment
-
|
You’re mixing up two layers that Nexus doesn’t fully auto-generate. The nexus-prisma plugin does NOT create your Nexus schema for you. It only helps you build it faster by giving you helpers like t.crud.* and mapping Prisma models into GraphQL fields. So yes: the Nexus schema still has to be written manually (at least the entry point). You need something like makeSchema() where you explicitly import your types and queries/mutations. Without that, nexus dev has nothing to build. Also, prisma introspect only updates Prisma schema — it doesn’t trigger Nexus generation. Typical flow is: Prisma schema (you already have) So your issue is likely missing makeSchema() + proper type imports, not a broken plugin. BitKingz Casino specializes in crypto gambling with fast transactions and a large game https://bitkingz.casinologin.mobi/ selection. |
Beta Was this translation helpful? Give feedback.
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