From c4bc0ec021efd608b8912a6038f44af84c0104a6 Mon Sep 17 00:00:00 2001 From: Jan Date: Tue, 20 Feb 2024 00:02:56 +0100 Subject: [PATCH] CM-549: fetch task using multiple entity ids --- tasks_management/schema.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tasks_management/schema.py b/tasks_management/schema.py index d465368..c9d796e 100644 --- a/tasks_management/schema.py +++ b/tasks_management/schema.py @@ -40,7 +40,8 @@ class Query(graphene.ObjectType): client_mutation_id=graphene.String(), groupId=graphene.String(), customFilters=graphene.List(of_type=graphene.String), - taskGroupId=graphene.String() + taskGroupId=graphene.String(), + entityIds=graphene.List(graphene.UUID), ) def resolve_task(self, info, **kwargs): @@ -53,6 +54,11 @@ def resolve_task(self, info, **kwargs): taskGroupId = kwargs.get("taskGroupId") if taskGroupId: filters.append(Q(task_group__id=taskGroupId)) + + entityIds = kwargs.get("entityIds") + if entityIds: + filters.append(Q(entity_id__in=entityIds)) + # not checking perms because get_queryset filters tasks assigned to user query = Task.objects.filter(*filters) return gql_optimizer.query(query, info)