hey guys! regarding 1.7 update, the generated pris...
# orm-help
b
hey guys! regarding 1.7 update, the generated prisma.graphql is now configured by a hook according to documentation. It's not clear to me what
graphql get-schema --project db
does. I use prisma (not graphql-framework neither graphql-yoga), I'm not sure I have access to this get-schema method. How could I generate the prisma.graphql? I need it as I import types from generated .graphql file to build my own graphql schema in top of prisma generated types.
n
hey 🙂
graphql get-schema --project db
uses the
graphql
CLI:
npm install graphql-cli
you might also have
graphql
as a dev dependency, then you can run (for example)
yarn graphql get-schema --project db
b
that was exactly what I just did now hahah. thank you, nilan!
🙌 1
@nilan it only works if I don't set a secret. makes sense as graphql- cli isn't explicitly passing an authorization header
n
ah I see!
can you use something like:
Copy code
TOKEN=Bearer ${prisma token}
graphql get-schema --header "{"Authorization": "TOKEN"}
sorry, the syntax might be wrong 🙂
👍 1
b
oh so it accept a --header param. nice!
n
it does, just looked it up with
graphql get-schema -h
🙂 I think the token syntax is not correct though 🤔
b
all commands have a --help, nice to know. thank you once again! I'll check the syntax, no problem!
may I ask you one more thing? the post-deploy hook is documented. But the pre-deploy isn't. at least I couldnt find
And I use #import in my datamodel
It would be nice if I could use graphql prepare to bundle my datamodel before prisma processes it.
is it possible with a kind of pre-deploy hook?
n
interesting, that's a great idea! currently, only post deployment hooks are supported. But I think that's a great idea, could you chime in here: https://github.com/graphcool/prisma/issues/1913?
b
sure! i'll check out the issue!
p.s: the issue with the syntax was related with double quotes inside double quotes
n
oh cool, can you reply here: https://github.com/graphcool/prisma/issues/2268? 🙂 that's so cool