Server Hosting
Overview
When building a GraphQL server based on Prisma, you need to host the GraphQL server to make its functionality available to client applications.
When hosting your GraphQL server (e.g. with Zeit Now, AWS Lambda or some other hosting provider), you should ensure that it is deployed to the same region as your Prisma service to ensure highest performance.
Deployment with Zeit Now
Now is a one-click deployment tool for web applications. You can find a comprehensive tutorial explaining how to deploy and host your Prisma-based GraphQL server with Now here.
Deployment with Apex Up
Apex Up allows you to deploy traditional web servers to AWS Lambda.
Deployment with the Serverless Framework
Another option to deploy your GraphQL server is by simply using a serverless functions provider, such as AWS Lambda, Google Cloud or Microsoft Azure. The easiest way to do so is by using the Serverless Framework.
Deploying your GraphQL server using a serverless functions provider is only possible if your clients are not using GraphQL subscriptions for realtime functionality.
The reason for that is that subscriptions require the web server to maintain state (because the server needs to remember which clients are subscribed to which events and retain an open connection to these clients). This is not possible with serverless functions.
To get started with the Serverless Framework, you need to install the CLI and sign up:
npm install -g serverless
serverless login
Depending on your serverless functions provider, you can then follow instructions from the quickstart documentation of the Serverless Framework: