feat: add search capability by name in getFlows

This commit is contained in:
Ali BARIN
2022-08-07 15:10:11 +02:00
parent ca141b1076
commit 726707afe8
2 changed files with 11 additions and 1 deletions

View File

@@ -3,6 +3,7 @@ import paginate from '../../helpers/pagination';
type Params = {
appKey?: string;
name?: string;
limit: number;
offset: number;
};
@@ -13,6 +14,10 @@ const getFlows = async (_parent: unknown, params: Params, context: Context) => {
.joinRelated('steps')
.withGraphFetched('steps.[connection]')
.where((builder) => {
if (params.name) {
builder.where('flows.name', 'like', `%${params.name}%`);
}
if (params.appKey) {
builder.where('steps.app_key', params.appKey);
}

View File

@@ -4,7 +4,12 @@ type Query {
getConnectedApps(name: String): [App]
testConnection(id: String!): Connection
getFlow(id: String!): Flow
getFlows(limit: Int!, offset: Int!, appKey: String): FlowConnection
getFlows(
limit: Int!
offset: Int!
appKey: String
name: String
): FlowConnection
getStepWithTestExecutions(stepId: String!): [Step]
getExecutions(limit: Int!, offset: Int!): ExecutionConnection
getExecutionSteps(