Hello, I am quite new to Prisma - nexus and have a...
# orm-help
l
Hello, I am quite new to Prisma - nexus and have a basic question. Is there any way to create automatic nexus schema definition from prisma database definition file? I have a project using prismic but will need to add a graphql API on top, so reading the docs I see the way to go is use
nexus/schema
and
nexus-plugin-prismic
to create the schema an then use it into
apollo-server
or
graphql-yoga
. My question is if there is any way to automatically build
NexusSchema.makeSchema
? Or maybe i am confused and the way to go is to pass the
nexus-prismic-plugin
as a plugin options to
makeSchema
and this should be enough? Thanks in advance!
r
Hey @Lucas 👋 Nexus doesn’t support automatically creating schema definitions from a Prisma file, but you can use this tool made by @Ahmed for the same. https://paljs.com/generator/nexus
l
Cool, thanks @Ryan
If I use the nexus-prisma-plugin the schema will be auto generated based on my databse sdl configuration?
or i still need to define each model/type on makeSchema?
r
nexus-plugin-prisma
will only automatically create your
schema.graphql
file. The models would have to be written by you manually and passed to
makeSchema
.
l
Got it! Thank you very much 🙂
🙌 1