Files
automatisch/packages/backend/src/graphql/queries/get-execution.ts
2022-11-05 23:57:33 +01:00

26 lines
454 B
TypeScript

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)
.throwIfNotFound();
return execution;
};
export default getExecution;