refactor: Use relations to expose dataOut field of execution steps
This commit is contained in:
@@ -18,7 +18,6 @@ const getStepWithTestExecutionsResolver = async (
|
|||||||
const previousStepsWithCurrentStep = await req.currentUser
|
const previousStepsWithCurrentStep = await req.currentUser
|
||||||
.$relatedQuery('steps')
|
.$relatedQuery('steps')
|
||||||
.withGraphJoined('executionSteps')
|
.withGraphJoined('executionSteps')
|
||||||
.select('steps.*', 'executionSteps.data_out as output')
|
|
||||||
.where('flow_id', '=', step.flowId)
|
.where('flow_id', '=', step.flowId)
|
||||||
.andWhere('position', '<', step.position)
|
.andWhere('position', '<', step.position)
|
||||||
.distinctOn('executionSteps.step_id')
|
.distinctOn('executionSteps.step_id')
|
||||||
|
@@ -4,9 +4,11 @@ import {
|
|||||||
GraphQLEnumType,
|
GraphQLEnumType,
|
||||||
GraphQLInt,
|
GraphQLInt,
|
||||||
GraphQLInputObjectType,
|
GraphQLInputObjectType,
|
||||||
|
GraphQLList,
|
||||||
} from 'graphql';
|
} from 'graphql';
|
||||||
import { GraphQLJSONObject } from 'graphql-type-json';
|
import { GraphQLJSONObject } from 'graphql-type-json';
|
||||||
import ConnectionType from './connection';
|
import ConnectionType from './connection';
|
||||||
|
import ExecutionStepType from './execution-step';
|
||||||
|
|
||||||
const stepType = new GraphQLObjectType({
|
const stepType = new GraphQLObjectType({
|
||||||
name: 'Step',
|
name: 'Step',
|
||||||
@@ -34,6 +36,9 @@ const stepType = new GraphQLObjectType({
|
|||||||
output: { type: GraphQLJSONObject },
|
output: { type: GraphQLJSONObject },
|
||||||
position: { type: GraphQLInt },
|
position: { type: GraphQLInt },
|
||||||
status: { type: GraphQLString },
|
status: { type: GraphQLString },
|
||||||
|
executionSteps: {
|
||||||
|
type: GraphQLList(ExecutionStepType),
|
||||||
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user