From 0c183eeadd60ba082d97e8a58f3fb07f755926aa Mon Sep 17 00:00:00 2001 From: Faruk AYDIN Date: Thu, 3 Mar 2022 20:54:13 +0300 Subject: [PATCH] refactor: Use relations to expose dataOut field of execution steps --- .../src/graphql/queries/get-step-with-test-executions.ts | 1 - packages/backend/src/graphql/types/step.ts | 5 +++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/backend/src/graphql/queries/get-step-with-test-executions.ts b/packages/backend/src/graphql/queries/get-step-with-test-executions.ts index 2714d937..aabd869c 100644 --- a/packages/backend/src/graphql/queries/get-step-with-test-executions.ts +++ b/packages/backend/src/graphql/queries/get-step-with-test-executions.ts @@ -18,7 +18,6 @@ const getStepWithTestExecutionsResolver = async ( const previousStepsWithCurrentStep = await req.currentUser .$relatedQuery('steps') .withGraphJoined('executionSteps') - .select('steps.*', 'executionSteps.data_out as output') .where('flow_id', '=', step.flowId) .andWhere('position', '<', step.position) .distinctOn('executionSteps.step_id') diff --git a/packages/backend/src/graphql/types/step.ts b/packages/backend/src/graphql/types/step.ts index 0b0819d2..0dddef85 100644 --- a/packages/backend/src/graphql/types/step.ts +++ b/packages/backend/src/graphql/types/step.ts @@ -4,9 +4,11 @@ import { GraphQLEnumType, GraphQLInt, GraphQLInputObjectType, + GraphQLList, } from 'graphql'; import { GraphQLJSONObject } from 'graphql-type-json'; import ConnectionType from './connection'; +import ExecutionStepType from './execution-step'; const stepType = new GraphQLObjectType({ name: 'Step', @@ -34,6 +36,9 @@ const stepType = new GraphQLObjectType({ output: { type: GraphQLJSONObject }, position: { type: GraphQLInt }, status: { type: GraphQLString }, + executionSteps: { + type: GraphQLList(ExecutionStepType), + }, }; }, });