GraphQL bindings connect your resolvers to the Prisma API

GraphQL bindings enable accessing a GraphQL API from your programming language. Combined with Prisma, they provide an efficient "GraphQL ORM" layer to simplify your resolvers.

1

Design the GraphQL API you want for your clients

2

Implement the resolvers by delegating incoming queries to the underlying Prisma API using GraphQL bindings

3

Bindings construct corresponding queries to Prisma

Query
Resolvers
Node
Typescript
Go
Python
Java
Scala
Ruby
Query

GraphQL bindings drastically
simplify your resolvers

With Prisma and GraphQL bindings, most of your resolvers are implemented as simple one-liners where incoming queries are delegated to the Prisma API. No more complex or brittle SQL inside your resolver functions.

  • Most resolvers are implemented as simple one-liners
  • Queries are delegated to Prisma API
  • Heavy-lifting performed by Prisma engine

Amazing DX based on code
generation and type safety

Developer experience reaches a new level with GraphQL bindings. Static code generation (e.g. for TypeScript) enables a type safe access of GraphQL APIs and will highlight typos and other structural errors at compile-time.

  • Type safe access to GraphQL APIs from your server
  • Write less code by using schema delegation in resolvers
  • Auto-completion for GraphQL requests in your IDE

Integrated data loader for top
performance

Resolving nested GraphQL queries is tricky and can easily lead to performance issues. GraphQL bindings are using the data loader pattern to ensure efficient query resolution in complex scenarios.

  • Avoid performance bottlenecks for nested queries
  • Per-request caching to minimize database hits
  • Efficient query resolution in complex scenarios

What are GraphQL Bindings?

GraphQL bindings are functions in your programming language that let you send queries, mutations and subscriptions to a GraphQL API. The functions are generated based on a GraphQL schema and mirror the GraphQL API.

Think of GraphQL bindings as an auto-generated SDK for a particular GraphQL API.

Learn More

FAQ

Do I have to use GraphQL
bindings?

Using bindings is a convenient way to create GraphQL servers that use Prisma as data access layer. As Prisma is a standard GraphQL API, you are free to use it like any other GraphQL API.

Can I use bindings with my
existing server?

It is easy to gradually introduce GraphQL bindings in an existing project. There is no need to do a big bang migration or start from scratch.

What languages are supported
by GraphQL bindings?

Currently GraphQL bindings support JavaScript and TypeScript. In the future we will support more languages as well as an optimised transport based on Protocol Buffers.

How do GraphQL bindings compare
to conventional ORMs?

GraphQL bindings solve the same problem as ORMs - however, they do so in a very different way and without the limitations commonly encountered with conventional ORMs.

  • Increased expressiveness and flexibility with GraphQL
  • Query performance ensured through various optimization techniques
  • Bindings automatically kept in sync with database schema
  • Type safe database access based on GraphQL schema

How does code generation work
with GraphQL bindings?

GraphQL bindings is a general framework that makes it easy to generate a powerful GraphQL SDK. The Prisma GraphQL binding is generated based on the Prisma data model.

  • General codegen framework
     
  • Easily generate custom GraphQL SDK
     
  • Prisma bindings generated from datamodel
     
  • Complete type safety and swappable transport