Why Bedrock uses Pothos to create its GraphQL schema

Max's Face
Max Stoiber

Pothos is a code-first TypeScript library to write GraphQL schemas. I've written my GraphQL schemas code-first for years now, and I'm never going back. Four reasons:

  • Incredible TypeScript support: I just start typing and Pothos auto-completes me! Not only that, but I don't have to manually annotate a single resolver and they're still fully type-safe.
  • Single source of truth: Having a schema and a separate list of resolvers that I have to manually match is prone to bugs and impossible to do type-safely. With Pothos, I have a single source of truth for both.
  • Prisma integration: The Prisma plugin means I can quickly expose database fields without having to write resolvers for every single thing. That saves me time and is more type-safe. Win-win!
  • Immense plugin ecosystem: Pothos plugin ecosystem makes creating GraphQL schemas so simple. Between the Prisma plugin and the Relay connections plugin, a majority of the manual work of creating a good schema is already done.

All in all, I would highly recommend using Pothos for your next project, which is why Bedrock comes pre-configured with Pothos out of the box. However, it lets you write your GraphQL schema a different way if you prefer, of course!

Jumpstart your next SaaS product with Bedrock

The modern full-stack Next.js & GraphQL boilerplate by @mxstbr with authentication, subscription payments, teams, invitations, emails and everything else you need

Learn more