Hey guys ... in the "Prisma under the Hood" sectio...
# orm-help
g
Hey guys ... in the "Prisma under the Hood" section, of the docs, there is mention of running multiple Prisma services on a single server. Now, if I need my client (web app) to make a single
/graphql
call which contains data from multiple of these services, what would be the best approach? Is this where schema stitching comes in? Is there a suggested pattern (or maybe some sample code) of how to do this in the Prisma ecosystem?
n
Schema stitching is an advanced GraphQL concept. You don't need it to tackle this situation. You can simple initialize multiple
prisma-binding
or Prisma Client instances in your GraphQL server, that all call out to different Prisma endpoints.
g
@nilan... intersting idea. I suppose it depends on the use case. Let use an example of two microservices: Orders and Products. Orders are related to products. So, I could either have multiple instances of the prisma client (one for each microservice) in my web app. In this case I would make one call to the Order microserivce and another to the realted Product service, via the prisma client, and then build a nested object client-side. OR ... I could have a graphql gateway, which stitches the Order and Product schemas toegther, and then have a single prisma client that makes a single request to the gateway, which will respond with a nested result.