diff --git a/packages/backend/src/graphql/mutation-resolvers.js b/packages/backend/src/graphql/mutation-resolvers.js index 06449fca..2e9a697f 100644 --- a/packages/backend/src/graphql/mutation-resolvers.js +++ b/packages/backend/src/graphql/mutation-resolvers.js @@ -1,5 +1,4 @@ // Converted mutations -import executeFlow from './mutations/execute-flow.js'; import verifyConnection from './mutations/verify-connection.js'; import updateCurrentUser from './mutations/update-current-user.js'; import generateAuthUrl from './mutations/generate-auth-url.js'; @@ -9,7 +8,6 @@ import updateConnection from './mutations/update-connection.js'; const mutationResolvers = { createConnection, - executeFlow, generateAuthUrl, resetConnection, updateConnection, diff --git a/packages/backend/src/graphql/mutations/execute-flow.js b/packages/backend/src/graphql/mutations/execute-flow.js deleted file mode 100644 index 501b723b..00000000 --- a/packages/backend/src/graphql/mutations/execute-flow.js +++ /dev/null @@ -1,28 +0,0 @@ -import testRun from '../../services/test-run.js'; -import Step from '../../models/step.js'; - -const executeFlow = async (_parent, params, context) => { - const conditions = context.currentUser.can('update', 'Flow'); - const isCreator = conditions.isCreator; - const allSteps = Step.query(); - const userSteps = context.currentUser.$relatedQuery('steps'); - const baseQuery = isCreator ? userSteps : allSteps; - - const { stepId } = params.input; - - const untilStep = await baseQuery.clone().findById(stepId).throwIfNotFound(); - - const { executionStep } = await testRun({ stepId }); - - if (executionStep.isFailed) { - throw new Error(JSON.stringify(executionStep.errorDetails)); - } - - await untilStep.$query().patch({ - status: 'completed', - }); - - return { data: executionStep.dataOut, step: untilStep }; -}; - -export default executeFlow; diff --git a/packages/backend/src/graphql/schema.graphql b/packages/backend/src/graphql/schema.graphql index 710ad2e8..b727fe7f 100644 --- a/packages/backend/src/graphql/schema.graphql +++ b/packages/backend/src/graphql/schema.graphql @@ -3,7 +3,6 @@ type Query { } type Mutation { createConnection(input: CreateConnectionInput): Connection - executeFlow(input: ExecuteFlowInput): executeFlowType generateAuthUrl(input: GenerateAuthUrlInput): AuthLink resetConnection(input: ResetConnectionInput): Connection updateConnection(input: UpdateConnectionInput): Connection @@ -153,11 +152,6 @@ type ConnectionData { screenName: String } -type executeFlowType { - data: JSONObject - step: Step -} - type ExecutionStep { id: String executionId: String @@ -232,10 +226,6 @@ input VerifyConnectionInput { id: String! } -input ExecuteFlowInput { - stepId: String! -} - input UserRoleInput { id: String } diff --git a/packages/web/src/graphql/mutations/execute-flow.js b/packages/web/src/graphql/mutations/execute-flow.js deleted file mode 100644 index ba9c40b7..00000000 --- a/packages/web/src/graphql/mutations/execute-flow.js +++ /dev/null @@ -1,12 +0,0 @@ -import { gql } from '@apollo/client'; -export const EXECUTE_FLOW = gql` - mutation ExecuteFlow($input: ExecuteFlowInput) { - executeFlow(input: $input) { - step { - id - status - } - data - } - } -`;