I'm having a tough time moving from 1.6 to 1.8. I...
# orm-help
l
I'm having a tough time moving from 1.6 to 1.8. In particular,
Copy code
# prisma.yml
# ...
hooks:
  post-deploy:
    - echo "Deployment finished"
    - graphql get-schema --project prisma
    - graphql prepare
with
Copy code
#. .graphqlconfig.yml
#... 
  prisma:
    schemaPath: src/generated/prisma.graphql
    extensions:
      prisma: database/prisma.yml
      prepare-binding:
        output: src/generated/prisma.ts
        generator: prisma-ts
does not generate a new schema at src/generated/prisma.graphql on
prisma deploy
. What am I missing?
Update: It did work, but it only regenerates
prisma.graphql
if there's a change to the service. In my situation, I use the sandbox and
prisma deploy
ed from work, but I don't commit
prisma.graphql
(I guess I should). At home when I tried to generate it, it wouldn't do it. Changing the schema and changing it back with
deploy
worked
n
Did you add the post deployment hooks to
prisma.yml
?
l
I did. I was confused because if the
deploy
diff doesn't see a change, the deployment hook will not generate a new
prisma.graphql
even though it acts like it is. Is it possible to change that behavior so it also says "no changes detected?"
n
Oh sorry you shared the hooks already, didn't see that! 🙂 What do you mean with "it is acting like it is"? What happens when you run the command from the CLI directly?
l
That suggests, to me, that
prisma.graphql
was regenerated
n
yup - what happens when you run
graphql get-schema --project prisma
directly?
l
Same thing. My situation is probably an edge case. The exact flow was: 1. Do not commit
prisma.graphql
(we can debate if that's a good choice.. probably not) 2. Change an enum 3.
prisma deploy
4. Commit, push, and go home 5. New computer (at home),
prisma deploy
6. No change to
prisma.graphql
So on the home computer, I couldn't get an updated generated file until I changed the schema and
prisma deploy
n
this looks like a bug with
graphql prepare
, can you raise an issue here: https://github.com/graphql-cli/graphql-cli/issues?
as a workaround, I'd add
rm src/generated/prisma.graphql
, or commit the file to git
l
Yeah that'd work!
Just confusing because I thought the file was being rewritten even though there were no changes to the service
n
yea that should probably be changed
l
For anyone looking in, here's the issue. https://github.com/graphql-cli/graphql-cli/issues/297
n
thanks a lot 🙌
parrotwave6 1