From b0d73aabc2e8f6bd468f1347840fa059da3bf354 Mon Sep 17 00:00:00 2001 From: Ali BARIN Date: Wed, 25 Oct 2023 12:05:53 +0000 Subject: [PATCH] fix(queries/get-executions): recover flow and steps relations --- .../backend/src/graphql/queries/get-executions.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/backend/src/graphql/queries/get-executions.ts b/packages/backend/src/graphql/queries/get-executions.ts index 53b6ca3d..9ea50144 100644 --- a/packages/backend/src/graphql/queries/get-executions.ts +++ b/packages/backend/src/graphql/queries/get-executions.ts @@ -45,16 +45,18 @@ const getExecutions = async ( .clone() .joinRelated('executionSteps as execution_steps') .select('executions.*', raw(selectStatusStatement)) + .groupBy('executions.id') + .orderBy('updated_at', 'desc'); + + const computedExecutions = Execution + .query() + .with('executions', executions) .withSoftDeleted() .withGraphFetched({ flow: { steps: true, }, - }) - .groupBy('executions.id') - .orderBy('updated_at', 'desc'); - - const computedExecutions = Execution.query().with('executions', executions); + }); if (filters?.flowId) { computedExecutions.where('executions.flow_id', filters.flowId);