From 8cd9f8d82a90b3c3ed71b2f64c14aeadbc7a20e8 Mon Sep 17 00:00:00 2001 From: Pau Date: Wed, 30 Oct 2024 13:20:53 +0100 Subject: [PATCH] fix: can update soft deleted records --- .../graphql-query-runner.service.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/packages/twenty-server/src/engine/api/graphql/graphql-query-runner/graphql-query-runner.service.ts b/packages/twenty-server/src/engine/api/graphql/graphql-query-runner/graphql-query-runner.service.ts index 2330ec472815..194ba68ef044 100644 --- a/packages/twenty-server/src/engine/api/graphql/graphql-query-runner/graphql-query-runner.service.ts +++ b/packages/twenty-server/src/engine/api/graphql/graphql-query-runner/graphql-query-runner.service.ts @@ -163,7 +163,19 @@ export class GraphqlQueryRunnerService { >( 'findOne', { - filter: { id: { eq: args.id } }, + filter: { + and: [ + { id: { eq: args.id } }, + { + // Hack to include soft deleted records + // Search for "withSoftDeleted" and "applyDeletedAtToBuilder" for more context + or: [ + { deletedAt: { is: 'NULL' } }, + { deletedAt: { is: 'NOT_NULL' } }, + ], + }, + ], + }, }, options, );