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 Execution from '../../models/execution';
|
||||||
import paginate from '../../helpers/pagination';
|
import paginate from '../../helpers/pagination';
|
||||||
|
|
||||||
|
type Filters = {
|
||||||
|
flowId?: string;
|
||||||
|
}
|
||||||
|
|
||||||
type Params = {
|
type Params = {
|
||||||
limit: number;
|
limit: number;
|
||||||
offset: number;
|
offset: number;
|
||||||
|
filters?: Filters;
|
||||||
};
|
};
|
||||||
|
|
||||||
const getExecutions = async (
|
const getExecutions = async (
|
||||||
@@ -41,6 +46,10 @@ const getExecutions = async (
|
|||||||
.groupBy('executions.id')
|
.groupBy('executions.id')
|
||||||
.orderBy('updated_at', 'desc');
|
.orderBy('updated_at', 'desc');
|
||||||
|
|
||||||
|
if (params.filters?.flowId) {
|
||||||
|
executions.where('flow_id', params.filters.flowId);
|
||||||
|
}
|
||||||
|
|
||||||
return paginate(executions, params.limit, params.offset);
|
return paginate(executions, params.limit, params.offset);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -20,7 +20,11 @@ type Query {
|
|||||||
): FlowConnection
|
): FlowConnection
|
||||||
getStepWithTestExecutions(stepId: String!): [Step]
|
getStepWithTestExecutions(stepId: String!): [Step]
|
||||||
getExecution(executionId: String!): Execution
|
getExecution(executionId: String!): Execution
|
||||||
getExecutions(limit: Int!, offset: Int!): ExecutionConnection
|
getExecutions(
|
||||||
|
limit: Int!
|
||||||
|
offset: Int!
|
||||||
|
filters: ExecutionFiltersInput
|
||||||
|
): ExecutionConnection
|
||||||
getExecutionSteps(
|
getExecutionSteps(
|
||||||
executionId: String!
|
executionId: String!
|
||||||
limit: Int!
|
limit: Int!
|
||||||
@@ -795,6 +799,10 @@ type Notification {
|
|||||||
description: String
|
description: String
|
||||||
}
|
}
|
||||||
|
|
||||||
|
input ExecutionFiltersInput {
|
||||||
|
flowId: String
|
||||||
|
}
|
||||||
|
|
||||||
schema {
|
schema {
|
||||||
query: Query
|
query: Query
|
||||||
mutation: Mutation
|
mutation: Mutation
|
||||||
|
Reference in New Issue
Block a user