feat: add getExecution query
This commit is contained in:
24
packages/backend/src/graphql/queries/get-execution.ts
Normal file
24
packages/backend/src/graphql/queries/get-execution.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import Context from '../../types/express/context';
|
||||
|
||||
type Params = {
|
||||
executionId: string;
|
||||
};
|
||||
|
||||
const getExecution = async (
|
||||
_parent: unknown,
|
||||
params: Params,
|
||||
context: Context
|
||||
) => {
|
||||
const execution = await context.currentUser
|
||||
.$relatedQuery('executions')
|
||||
.withGraphFetched({
|
||||
flow: {
|
||||
steps: true
|
||||
}
|
||||
})
|
||||
.findById(params.executionId);
|
||||
|
||||
return execution;
|
||||
};
|
||||
|
||||
export default getExecution;
|
@@ -5,6 +5,7 @@ import testConnection from './queries/test-connection';
|
||||
import getFlow from './queries/get-flow';
|
||||
import getFlows from './queries/get-flows';
|
||||
import getStepWithTestExecutions from './queries/get-step-with-test-executions';
|
||||
import getExecution from './queries/get-execution';
|
||||
import getExecutions from './queries/get-executions';
|
||||
import getExecutionSteps from './queries/get-execution-steps';
|
||||
import getData from './queries/get-data';
|
||||
@@ -19,6 +20,7 @@ const queryResolvers = {
|
||||
getFlow,
|
||||
getFlows,
|
||||
getStepWithTestExecutions,
|
||||
getExecution,
|
||||
getExecutions,
|
||||
getExecutionSteps,
|
||||
getData,
|
||||
|
@@ -12,6 +12,7 @@ type Query {
|
||||
name: String
|
||||
): FlowConnection
|
||||
getStepWithTestExecutions(stepId: String!): [Step]
|
||||
getExecution(executionId: String!): Execution
|
||||
getExecutions(limit: Int!, offset: Int!): ExecutionConnection
|
||||
getExecutionSteps(
|
||||
executionId: String!
|
||||
|
Reference in New Issue
Block a user