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;
|
Reference in New Issue
Block a user