hi! — I just started a new `prisma` project locall...
# orm-help
f
hi! — I just started a new
prisma
project locally (using docker). now I want to implement custom resolvers, but I'm not sure how to register them. the documentation always seems to assume that I'm using
graphql-yoga
directly... what am I missing here?
j
I'd recommend using the package
graphql-tools
and their method
makeExecutableSchema
. That will allow you to generate a schema, with custom resolvers, that you can pass to express-graphql or apollo-server-express or whatever other server you use. The benefit of graphql-yoga is that it allows you to write your schema in a
.graphql
file and import that directly 🙂 It's also a pretty nice server all around.
f
yeah, but I'm not using any of those servers directly. I'm simply using the prisma docker image — and I'm not even sure what that one is using...
j
Prisma is just a database layer. It gives you, through the
prisma-binding
package, a way to connect to the underlying database. I'd recommend the tutorial over at "How to GraphQL" to start with. It goes through all the steps. After you're done there you should be able to use docker-compose to run your own, local, Prisma/SQL server.
f
I have a running instance (with the API, and the playground) — that's all running in docker. I'm just not sure how I would add custom resolvers to that setup.
with
graphcool
you could just add custom functions to
graphcool.yml
. I guess I'm confused about how that works with
prisma
, when I'm actually not writing / running the server myself.