Closes https://github.com/twentyhq/core-team-issues/issues/248?issue=twentyhq%7Ccore-team-issues%7C1543 In this PR - Implementation of groupBy resolver, without pagination, without viewId parameter - introduction of new GqlInputTypeDefinitionKind `OrderByWithGroupBy` which differs from `OrderBy` as it should use aggregations as order by conditions (e.g.: OrderByWithGroupBy should use avgEmployees and not employees which does not make sense) - Minor refacto of all orderBy expressions to use orderBy signature with `OrderByCondition` which is usable for both groupBy queries and non-groupBy queries. groupBy queries differ because their orderBy conditions are based on aggregatedFields (such as avgEmployees) for which we can't use the same orderBy signature <img width="728" height="216" alt="Capture d’écran 2025-09-24 à 15 07 14" src="https://github.com/user-attachments/assets/aa5c0875-cf38-4d4b-be70-f4d64da77a41" /> - Minor refacto to add table name in aggregates expressions `(AVG("employees") -> AVG("company"."employees")` to keep having the table names in the orderBy expression as we already had. Since we use common utils for orderBy and aggregates on findMany this change also impacts findMany queries with aggregates. It also impacts field permission check where we extract the name of the selected fields to check permission on, so I also updated that (see `extractColumnNamesFromAggregateExpression`)
The #1 Open-Source CRM
🌐 Website · 📚 Documentation · Roadmap ·
Discord ·
Figma
Installation
See:
🚀 Self-hosting
🖥️ Local Setup
Does the world need another CRM?
We built Twenty for three reasons:
CRMs are too expensive, and users are trapped. Companies use locked-in customer data to hike prices. It shouldn't be that way.
A fresh start is required to build a better experience. We can learn from past mistakes and craft a cohesive experience inspired by new UX patterns from tools like Notion, Airtable or Linear.
We believe in Open-source and community. Hundreds of developers are already building Twenty together. Once we have plugin capabilities, a whole ecosystem will grow around it.
What You Can Do With Twenty
Please feel free to flag any specific needs you have by creating an issue.
Below are a few features we have implemented to date:
- Personalize layouts with filters, sort, group by, kanban and table views
- Customize your objects and fields
- Create and manage permissions with custom roles
- Automate workflow with triggers and actions
- Emails, calendar events, files, and more
Personalize layouts with filters, sort, group by, kanban and table views
Customize your objects and fields
Create and manage permissions with custom roles
Automate workflow with triggers and actions
Emails, calendar events, files, and more
Stack
- TypeScript
- Nx
- NestJS, with BullMQ, PostgreSQL, Redis
- React, with Recoil, Emotion and Lingui
Thanks
Thanks to these amazing services that we use and recommend for UI testing (Chromatic), code review (Greptile), catching bugs (Sentry) and translating (Crowdin).
Join the Community
- Star the repo
- Subscribe to releases (watch -> custom -> releases)
- Follow us on Twitter or LinkedIn
- Join our Discord
- Improve translations on Crowdin
- Contributions are, of course, most welcome!




