feat(queries/get-executions): add flowId filter support
This commit is contained in:
@@ -3,9 +3,14 @@ import Context from '../../types/express/context';
|
||||
import Execution from '../../models/execution';
|
||||
import paginate from '../../helpers/pagination';
|
||||
|
||||
type Filters = {
|
||||
flowId?: string;
|
||||
}
|
||||
|
||||
type Params = {
|
||||
limit: number;
|
||||
offset: number;
|
||||
filters?: Filters;
|
||||
};
|
||||
|
||||
const getExecutions = async (
|
||||
@@ -41,6 +46,10 @@ const getExecutions = async (
|
||||
.groupBy('executions.id')
|
||||
.orderBy('updated_at', 'desc');
|
||||
|
||||
if (params.filters?.flowId) {
|
||||
executions.where('flow_id', params.filters.flowId);
|
||||
}
|
||||
|
||||
return paginate(executions, params.limit, params.offset);
|
||||
};
|
||||
|
||||
|
@@ -20,7 +20,11 @@ type Query {
|
||||
): FlowConnection
|
||||
getStepWithTestExecutions(stepId: String!): [Step]
|
||||
getExecution(executionId: String!): Execution
|
||||
getExecutions(limit: Int!, offset: Int!): ExecutionConnection
|
||||
getExecutions(
|
||||
limit: Int!
|
||||
offset: Int!
|
||||
filters: ExecutionFiltersInput
|
||||
): ExecutionConnection
|
||||
getExecutionSteps(
|
||||
executionId: String!
|
||||
limit: Int!
|
||||
@@ -795,6 +799,10 @@ type Notification {
|
||||
description: String
|
||||
}
|
||||
|
||||
input ExecutionFiltersInput {
|
||||
flowId: String
|
||||
}
|
||||
|
||||
schema {
|
||||
query: Query
|
||||
mutation: Mutation
|
||||
|
Reference in New Issue
Block a user