I'm curious about subscriptions, prisma, and graph...
# prisma-whats-new
w
I'm curious about subscriptions, prisma, and graphql-yoga. If I hosted a graphql-yoga server in front of the new prismacloud, how do subscriptions work? Does the graphql-yoga server get notified in real-time, and then forward that info to clients connected to it? I guess that means that the graphql-yoga server can't run on lambda since it might not be running when subscription data is sent to it?
b
graphql-yoga can run on lambda, but you are right, it doesn’t work with subscriptions, because they depend on an open websockets connection. My solution is implementing all queries on lambda and then have some instances behind a load balancer that only do the subscription part.
so there are two options regarding the subscriptions: 1) you have an open websocket connection between each client and your service. Plus one between your service and prisma 2) you can use webhooks for subscriptions on prisma. that way you have one connection between each client and your service open and your service gets a http request for each subscription event on prisma
w
Thanks for the insight