Type-safe · v4.0

Schemas that grow with your code.

Pothos is a plugin-based GraphQL schema builder for TypeScript. Define your types once and they flow into every resolver without codegen or decorators. At the scale of Airbnb, Netflix, and your weekend project.

Read the guide MIT · open source
schema/user.tsTypeScript
import SchemaBuilder from '@pothos/core';
const builder = new SchemaBuilder<{ Context: Context }>();
// Type the object by its backing model.
const User = builder.objectRef<{ id: string; name: string }>('User');
User.implement({
fields: (t) => ({
id: t.exposeID('id'),
name: t.exposeString('name'),
// user and ctx arrive typed — no annotations.
posts: t.field({
type: [Post],
resolve: (user, _args, ctx) => loadPosts(user.id, ctx),
}),
}),
});

Where the types come from.

You write two type annotations here: your context on the builder, and the model backing User. In the last resolver, user and ctx are typed from those, without annotations of their own.

0codegen steps
1peer dependency (graphql)
18first-party plugins
The plugin garden

Plugins that feel built in.

Browse all 18 plugins →
In use at some of the largest tech companies, includingAirbnbNetflix