twentyhq / twenty

Building a modern alternative to Salesforce, powered by the community.
https://twenty.com
GNU Affero General Public License v3.0
14.99k stars 1.47k forks source link

Create queryRawSql #5443

Open FelixMalfait opened 1 month ago

FelixMalfait commented 1 month ago

Would be great to have a resolver that could be used like this

 queryRaw(query: "select id, value from user where ... groupBy ... join ...) {
    id: uuid;
        value: number;
}

That resolver could then be used to easily build a text-to-sql-to-chart feature.

Related post that can help: https://wundergraph.com/blog/embedding_sql_into_graphql_without_sacrificing_type_safety

Think about security while building this

kaafivikrant commented 1 week ago

@FelixMalfait , As twenty, is already using typeORM, are you suggesting replacing it with this approach or do you want this to be implemented at a specific DB query?

Let me know.