Both events have resulted in many questions and confusion in our community that I’d like to address in this post.
Prisma is an open-source GraphQL query engine that turns your database into a GraphQL API. It is the perfect foundation to help you build GraphQL servers.
You can potentially connect to Prisma directly from the frontend - but most applications will need a server in front of Prisma to handle things like authentication, integrations of 3rd party services and other business logic.
The best way to build that server is by using GraphQL Yoga and Prisma bindings. Thanks to the bindings, the implementation of the GraphQL server is almost trivial as the heavy-lifting for query resolution is done by Prisma (i.e. generating database queries and reading/writing to/from the database). To see what a GraphQL server built with
graphql-yoga and Prisma bindings look like, check out the GraphQL boilerplate projects for Node and TypeScript.
Learn how to build a GraphQL server with graphql-yoga and Prisma in this tutorial.
Because Prisma is entirely open-source, you can host it yourself using your favorite cloud provider (based on Docker). If you don’t want to deal with such infrastructure management, the easiest way to run Prisma in production is by using Prisma Cloud.
The Graphcool Framework is an open-source and self-hosted GraphQL backend-as-a-service that provides an opinionated backend setup:
- A GraphQL query engine and web server
- A serverless function component, providing means to implement common workflows like authentication or other business logic
- A permission system, based on GraphQL permission queries
- The graphcool CLI, that is used to deploy a specific configuration of the above components to a Graphcool service
You can read more about the Graphcool Framework in the documentation.
Prisma or Graphcool Framework?
There’s a detailed discussion in this forum thread about why it can be beneficial to use Prisma over the Graphcool Framework.
Prisma is the perfect choice if you need a fully-fledged GraphQL server. In combination with graphql-yoga and Prisma bindings, it allows to quickly build powerful GraphQL servers that are flexible and cater to all your use cases. Using GraphQL boilerplates, you can easily bootstrap the foundation for your GraphQL server that already comes with features like authentication and realtime capabilities. To deploy your GraphQL server to the web, you can use great one-click deployment tools such as Zeit Now or Apex Up.
Graphcool Framework offers an opinionated backend setup.
If you like the concepts and features of Graphcool Framework and it fits your use case then consider using it. If you like to have more flexibility and more choice in how to put together your GraphQL backend stack, then I encourage you to check out Prisma for your next project.
Due to several renamings of repositories and both CLIs during the Prisma developer preview, you might come across inaccurate documentation or broken links. We are currently going through all our resources accordingly. If you encounter anything unexpected, you are welcome to provide your feedback here.
If you have any question at all about the Graphcool Framework or Prisma, don’t hesitate to post it in this thread.