From 0c24001e23060f112d81d41c97eb5ceca6aa52d6 Mon Sep 17 00:00:00 2001 From: martmull Date: Fri, 18 Oct 2024 10:20:21 +0200 Subject: [PATCH] Fix update event webhook triggering (#7814) --- .../graphql-query-runner.service.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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 7eb55d60ae..2330ec4728 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 @@ -361,19 +361,21 @@ export class GraphqlQueryRunnerService { authContext.workspace.id, ); + const resultWithGettersArray = Array.isArray(resultWithGetters) + ? resultWithGetters + : [resultWithGetters]; + await this.workspaceQueryHookService.executePostQueryHooks( authContext, objectMetadataItem.nameSingular, operationName, - Array.isArray(resultWithGetters) - ? resultWithGetters - : [resultWithGetters], + resultWithGettersArray, ); const jobOperation = this.operationNameToJobOperation(operationName); if (jobOperation) { - await this.triggerWebhooks(resultWithGetters, jobOperation, options); + await this.triggerWebhooks(resultWithGettersArray, jobOperation, options); } return resultWithGetters;