One GraphQL schema.
Per customer.
An open-source CRM’s API, generated on the fly for each customer.
- Year
- 2023–25
- Duration
- 22 months
- Team
- 1 senior
- Stack
- NestJS · GraphQL Yoga · Postgres
Context
Twenty is an open-source CRM with 58,000+ stars on GitHub. Every customer creates their own objects and fields: the API has to mirror each workspace’s data model.
The challenge
GraphQL is static by nature: one schema, built at startup. Each workspace needed its own schema, on every request, derived from the user’s token, without wrecking performance.
What we shipped
- A GraphQL Yoga patch for NestJS: a conditional schema per token
- Types, queries and resolvers generated from workspace metadata
- Per-workspace schema cache, invalidated when metadata changes
- Twenty ORM for standard and custom objects
- Workspace metadata sync and health checks
- New relation system, soft delete, “created by” field
- On the front end: group by for tables and kanbans
A similar problem?
30 minutes with a senior to talk it through, free.
More work
02 / SEPHORA · MULTI-COUNTRY MONOREPO
Multiple apps.
One codebase.
One monorepo, three apps for Europe and the Middle East. Each country gets its typed settings on launch, LTR and RTL alike.
60app variants, one repo
0per-country forks
04 / EPSOR · UNIVERSAL APP
Web and mobile.
One codebase.
Six months backing two fintech teams: the mobile app brought into the monorepo, screens shared with the web, and a new app whose design changes per client.
4web and mobile apps, one monorepo
200 000+employees on the platform