Hello everyone I have a general questions just a p...
# orm-help
r
Hello everyone I have a general questions just a pointer in the right direction. I would like to use prisma-client not only for a database layer, but also possibly add additional api endpoint/services to my application. For example I want to have graphql for my own schema via prisma alongside creating a graphql layer for Redmine, where in the app itself I can hit prisma as well as hit my api
p
I don't fully understand the question. You want to create a prisma/rest resource for the server and allow your app (client) to hit both the graphql endpoint as well as use rest endpoint. Is this correct?
r
correct. more specifically I realized that Prisma init used to give an option to create an app, and now it just create a prisma instance. How do I get back the option to generate an app
where I can create custom queries and mutations based on the external api that I want to included in my "prisma app"
so to speak
p
Take a look at an example such as this one: https://github.com/prisma/prisma-examples/tree/master/typescript/graphql-auth The docker-compose I posted above can be used to spin up a prisma instance that connects to database (mongodb in this case) and the graphql-auth example can be built as a middle layer with custom queries and mutations. You can also call different REST endpoints and serve the data via a single graphql endpoint.
[CLIENT] <---> [graphql-auth] <---> [docker-compose.yml] <---> [DATABASE]
Something along those lines. graphql-auth would be your resource server.