Hi. I just use nexus-prisma, it works well except ...
# orm-help
b
Hi. I just use nexus-prisma, it works well except I don't see schema.graphql in
generated
folder. There is no errors when running graphql server, does anyone have this problem and how to fix it. Thanks!
Copy code
const Query = prismaObjectType({
    name: 'Query',
    definition: t => t.prismaFields(['*']),
  })
  const Mutation = prismaObjectType({
    name: 'Mutation',
    definition: t => t.prismaFields(['*']),
  })

  const schema = makePrismaSchema({
    types: [Query, Mutation],
    prisma: {
      datamodelInfo: metaSchema,
      client: prisma,
    },

    outputs: {
      schema: path.join(__dirname, './generated/schema.graphql'),
      typegen: path.join(__dirname, './generated/nexus.ts'),
    },
  })
m
Hi, which version do you have installed? 0.3.1 is generating them well for me.
b
I'm using nexus-prisma 0.3.1
m
But is it generating the nexus.ts file?
b
no, both files do not exist 😄
I just clone nexus-prisma and run the example, it can generate these files, I will find the problem
m
The main difference that can I see with your code and mine it's I'm not using metaSchema (it's outdated the example I think)
import datamodelInfo from './generated/nexus-prisma' const schema = makePrismaSchema({ types: [Query, Mutation], // Configure the interface to Prisma prisma: { datamodelInfo, client: prisma, }, outputs: { schema: path.join(__dirname, './generated/nexus/schema.graphql'), typegen: path.join(__dirname, './generated/nexus/nexus.ts'), }, })
b
I don't think
datamodelInfo
causes the issue.
a
Did you run
prisma deploy
yet?
m
I supposed that you have executed the
prisma deploy
and in the post-deploy hooks you have
npx nexus-prisma-generate --client ./generated/prisma-client --output ./generated/nexus-prisma
b
Copy code
hooks:
  post-deploy:
    - prisma generate
    - npx nexus-prisma-generate --client ./src/generated/prisma-client --output ./src/generated/nexus-prisma
and here is my generated folder
m
Have you tried with the above code about datamodelInfo?
b
I tried, it didn't work
a
Is
nexus
installed as well?
b
of course, nexus is installed
"nexus": "^0.9.14",
m
Strange, I have deleted generated/nexus content and start the index.ts and I have again my schema.graphql and nexus.ts files
b
yeah, very weird, I can't find out the problem fast parrot
finally, I find the problem. Here is my
start
script:
"start": "ts-node-dev -r dotenv/config --no-notify --respawn --transpileOnly ./src"
, when I delete
-r dotenv/config
, nexus.ts and schema.graphql will be generated fast parrot
m
😂
b
I copy this option from
ts-node
command
✔️ 1
I think it's an issue, I will report it 🤣
😁 1