feat: Implement initial version of processor

This commit is contained in:
Faruk AYDIN
2022-02-20 17:34:28 +03:00
committed by Ömer Faruk Aydın
parent 4a8c3988c2
commit ba2b5afe2b
5 changed files with 88 additions and 19 deletions

View File

@@ -1,6 +1,7 @@
import { GraphQLString, GraphQLNonNull } from 'graphql';
import RequestWithCurrentUser from '../../types/express/request-with-current-user';
import executeFlowType from '../types/execute-flow';
import Processor from '../../services/processor';
type Params = {
stepId: string;
@@ -18,9 +19,8 @@ const executeFlowResolver = async (
})
.throwIfNotFound();
const appClass = (await import(`../../apps/${step.appKey}`)).default;
const appInstance = new appClass(step.connection.data);
const data = await appInstance.triggers[step.key].run();
const flow = await step.$relatedQuery('flow');
const data = await new Processor(flow, step).run();
await step.$query().patch({
status: 'completed',