Hello! I’m getting this after a successful `prisma...
# orm-help
p
Hello! I’m getting this after a successful `prisma deploy`:
Copy code
post-deploy:
Running graphql get-schema --project prisma !
 ▸    'ENOENT': spawn graphql ENOENT

Get in touch if you need help: <https://www.graph.cool/forum>
To get more detailed output, run $ export DEBUG="*"
I’m using yarn workspaces, so my GraphQL API is in a folder called
api
that is at the same level as my
prisma
folder. The former contains my
.graphqlconfig.yml
file and the latter contains my
prisma.yml
file.
n
do you have a global installation of
graphql-cli
?
p
I don’t remember, I’ll check shortly. I went to the movies 😂
😂 1
n
it looks like you don't have it! 😄 enjoy the movie!
p
Thank you, it was good, I recommend it! “Transit” 😉
👌 1
I installed
graphql-cli
globally and it worked, but I get the error message now that the file I want to generate does not exist!
I believe I then must run
graphql create
at least once
Copy code
post-deploy:
Running graphql get-schema --project prisma ✔

Running graphql prepare !
 ▸    Schema '/Users/Sammy/Projects/testing-yarn-workspaces/api/src/generated/prisma.graphqls' not found.
 ▸
Oh boy… so I created another project on the side and copied the generated files into this folder and ran
prisma deploy
once more; now I’m getting
Syntax Error: Cannot parse the unexpected character "/".
in
graphql prepare
!
n
that's weird! random question, did you recently add a
@unique
directive to your schema?
p
You mean the prisma schema or the API schema?
n
the Prisma datamodel (not the schema, sorry)
p
What I did was copy the prisma.* files from the generated folder to the new project. The new project only has the default
datamodel.graphql
file that gets generated by
prisma init
Do I understand correctly that
prisma deploy
will not generate the files if they do not already exist?
n
what version are you on?
p
1.7.4
n
prisma deploy
doesn't do any schema interaction except if you explicitely set it up as a post deployment hook
p
Sure, and it is so
This file is in the
api
folder:
Copy code
projects:
  app:
    schemaPath: "src/schema.graphql"
    extensions:
      endpoints:
        default: "<http://localhost:4000>"
  prisma:
    schemaPath: "src/generated/prisma.graphqls"
    extensions:
      prisma: ../prisma/prisma.yml
      prepare-binding:
        output: src/generated/prisma.ts
        generator: prisma-ts
and the
prisma
folder next to it
n
can you share the hooks from your
prisma.yml
?
p
Copy code
endpoint: ${env:PRISMA_ENDPOINT}
secret: ${env:PRISMA_SECRET}
datamodel:
  - types.graphqls
hooks:
  post-deploy:
    - graphql get-schema --project prisma
    - graphql prepare
n
what if you run
graphql get-schema --project prisma
directly from the CLI?
p
in the
api
folder?
Oh, it’s the file extension
Copy code
→ graphql get-schema --project prisma
✖ Unsupported schema file extention. Only ".graphql" and ".json" are supported
Yup, that was it
I don’t remember why I had set my auto-generator to create
.graphqls
files — I guess it was for the WebStorm extension
n
thanks, in any case the error should be printed: https://github.com/graphcool/prisma/issues/2362
you can add
cp src/generated/prisma.graphql src/generated/prisma.graphqls
as another hook if you want to 🙂