Quick question. I'm following the tutorials and ha...
# orm-help
c
Quick question. I'm following the tutorials and have done
prisma init
using the local docker. I do
prisma deploy
and it uploads the schema fine, but the generated
prisma.graphql
file is neither generated nor updated. This stopped working on an older app after I upgraded from 1.6 to the latest. But now I can't make it work even on a newly created app. The database end is fine -- works like a charm. I can access it through the playground database schema perfectly. But without that
prisma.graphql
file I can't do anything through the app schema. Has anyone else run into this problem with 1.8? Is there something really obvious I'm missing? Am I right in thinking that
prisma deploy
should regenerate
prisma.graphql
?
m
Can you show me your prisma.yml and .graphqlconfig.yml ?
c
I knew you were going to ask that. Unfortunately, they are on a work computer that is locked out of Slack (I work for a bank). But I will try to copy them over here (personal computer).
`.graphqlconfig.yml`:
Copy code
projects:
  app:
    schemaPath: src/schema.graphql
    extensions:
      endpoints:
        default: <http://localhost:4000>
  database:
    schemaPath: src/generated/prisma.graphql
    extensions:
      prisma: database/prisma.yml
`prisma.yml`:
m
At the end of graphqlconfig you might want to have prisma bindings
prepare-binding: output: src/generated/prisma.ts generator: prisma-ts
c
Copy code
endpoint: <http://localhost:4466/tracks/dev>
datamodel: datamodel.graphql
secret: 'somesecret'
m
in database>extentions
c
I'll try that.
m
and in prisma.yml you're missing the new hooks
hooks: post-deploy: - graphql get-schema --project database - graphql prepare
c
Ah! So it is a problem with the upgrade. I missed that. So my
.graphqlconfig.yml
should look like this:
Copy code
projects:
  app:
    schemaPath: src/schema.graphql
    extensions:
      endpoints:
        default: <http://localhost:4000>
  database:
    schemaPath: src/generated/prisma.graphql
    extensions:
      prisma: database/prisma.yml
      prepare-binding:
       output: src/generated/prisma.ts
       generator: prisma-ts
Correct?
And
prisma.yml
like this:
Copy code
endpoint: <http://localhost:4466/tracks/dev>
datamodel: datamodel.graphql
secret: 'somesecret'
hooks:
 post-deploy:
   - graphql get-schema --project database
   - graphql prepare
Correct?
m
Yes seems good
you might want to change prisma-ts to prisma-js and prisma.ts to prisma.js if you're using js
c
My thinking exactly. Will try it. Thanks!
👍 1
Ha! Beauty! You're a superstar. Thanks much!
m
I had the same issue yesterday hahah ! Have fun !
c
I will... now. 😎
👍 1