Skip to content

Installation

Install the packages you need depending on your use case.

If you plan to use all three packages (server + client + React hooks), install the umbrella package:

Terminal window
bun add graphql-suite graphql drizzle-orm @tanstack/react-query react

Then import from the scoped packages — this works with both install approaches:

import { buildSchema } from '@graphql-suite/schema'
import { createDrizzleClient } from '@graphql-suite/client'
import { GraphQLProvider, useEntity } from '@graphql-suite/query'

If you only need specific packages, install them separately. All three are published independently.

Terminal window
bun add @graphql-suite/schema graphql drizzle-orm

This is the core package. It takes your Drizzle table definitions and produces a full GraphQL schema at runtime.

Terminal window
bun add @graphql-suite/client drizzle-orm

A standalone client that builds type-safe GraphQL queries from your Drizzle schema. Works in any JavaScript environment (Node, Bun, browsers, React Native).

Terminal window
bun add @graphql-suite/query @tanstack/react-query react

Wraps the client in React hooks powered by TanStack Query. Use this if you are building a React frontend.

Each package has its own peer dependencies that you must install alongside it. This ensures your application uses a single copy of each library, avoiding version conflicts.

Package Peer dependencies
@graphql-suite/schema drizzle-orm >= 0.44.0, graphql ^16.4.0 || ^17.0.0
@graphql-suite/client drizzle-orm >= 0.44.0
@graphql-suite/query react >= 18.0.0, @tanstack/react-query >= 5.0.0

@graphql-suite/schema has no runtime dependencies of its own — graphql and drizzle-orm are the only libraries it loads, and both come from your app.

Both majors are supported, and CI builds, type-checks and tests the whole project against each. Pick whichever your server framework supports:

  • graphql 16 — the safe default, accepted everywhere in the current ecosystem.
  • graphql 17 — requires Node 22 or newer, and every other GraphQL library in your app has to accept it too. graphql-yoga supports graphql 17 from 5.22.0; on older versions requests carrying variables fail inside Yoga. graphql-http accepts it as well.

Whichever you choose, buildSchema() returns a plain GraphQLSchema, so the server library is your call — this package does not wrap one.

Install exactly one copy. Two copies of graphql in a single process fail instanceof checks against each other, and the schema breaks at query time with errors like Cannot use GraphQLNonNull "..." from another module or realm. If you hit that, check npm ls graphql (or bun pm ls graphql) for a duplicate pulled in by another dependency.