Merge pull request #430 from automatisch/issue-425
feat: add connectionId filter in getFlows query
This commit is contained in:
@@ -3,6 +3,7 @@ import paginate from '../../helpers/pagination';
|
||||
|
||||
type Params = {
|
||||
appKey?: string;
|
||||
connectionId?: string;
|
||||
name?: string;
|
||||
limit: number;
|
||||
offset: number;
|
||||
@@ -11,9 +12,19 @@ type Params = {
|
||||
const getFlows = async (_parent: unknown, params: Params, context: Context) => {
|
||||
const flowsQuery = context.currentUser
|
||||
.$relatedQuery('flows')
|
||||
.joinRelated('steps')
|
||||
.withGraphFetched('steps.[connection]')
|
||||
.joinRelated({
|
||||
steps: true
|
||||
})
|
||||
.withGraphFetched({
|
||||
steps: {
|
||||
connection: true
|
||||
}
|
||||
})
|
||||
.where((builder) => {
|
||||
if (params.connectionId) {
|
||||
builder.where('steps.connection_id', params.connectionId);
|
||||
}
|
||||
|
||||
if (params.name) {
|
||||
builder.where('flows.name', 'ilike', `%${params.name}%`);
|
||||
}
|
||||
|
@@ -8,6 +8,7 @@ type Query {
|
||||
limit: Int!
|
||||
offset: Int!
|
||||
appKey: String
|
||||
connectionId: String
|
||||
name: String
|
||||
): FlowConnection
|
||||
getStepWithTestExecutions(stepId: String!): [Step]
|
||||
|
Reference in New Issue
Block a user