Hi, after a `prisma deploy` and a post deploy hook...
# orm-help
d
Hi, after a
prisma deploy
and a post deploy hook to
graphql get-schema
how can i import the whole generated schema into my own (as i have some rest API stuff as well), rather than
# import OneThing from "./generated/schema.graphql"
m
afaik it is auto imported, all your database schema datatypes are available.
d
it didnt seem to be as when i used the playground its either just my own items in the schema tab or additionally OneThing if i import from the generated schema
m
Mhh ok, in my schema.graphql I can define the following:
Copy code
createPost(timeline: ID!, text: String, image: ID, slug: String): Post!
without ever importing or overriding the
Post
that was defined in my database schema.
And it works fine.
It would be a better practice to override these datatypes though btw 🙂
d
Yes, i can implement my own version of queries etc. I can certainly see the benefits of doing so, but would also like to understand how to make use of the generated one
m
Oh you mean the query? That is a different thing. I actually never tried to import a query, however, I dont think it is intended to be done. You should manually define your queries and then use resolver forwarding to pass them to your generated prisma queries. https://github.com/prismagraphql/prisma/tree/master/examples/resolver-forwarding
d
ok i will check that out. thanks
m
d
im not using typescript
on that resolver-forwarding example, i really found picking my way through using prisma and graphql-yoga really difficult.
@Moritz thanks, that forwardTo got me to where i wanted to be