diff --git a/api/graphql/schema.py b/api/graphql/schema.py index c2b458511..7b9a030f8 100644 --- a/api/graphql/schema.py +++ b/api/graphql/schema.py @@ -589,9 +589,9 @@ async def sample( project_name_map: dict[str, int] = {} if project: - project_ids = project.all_values() - projects = await ptable.get_and_check_access_to_projects_for_ids( - user=connection.author, project_ids=project_ids, readonly=True + project_names = project.all_values() + projects = await ptable.get_and_check_access_to_projects_for_names( + user=connection.author, project_names=project_names, readonly=True ) project_name_map = {p.name: p.id for p in projects} @@ -633,9 +633,9 @@ async def sequencing_groups( # we list project names, but internally we want project ids project_id_map = {} if project: - project_ids = project.all_values() - projects = await ptable.get_and_check_access_to_projects_for_ids( - user=connection.author, project_ids=project_ids, readonly=True + project_names = project.all_values() + projects = await ptable.get_and_check_access_to_projects_for_names( + user=connection.author, project_names=project_names, readonly=True ) project_id_map = {p.name: p.id for p in projects} diff --git a/test/test_graphql.py b/test/test_graphql.py index 2078b1184..294e1ad56 100644 --- a/test/test_graphql.py +++ b/test/test_graphql.py @@ -209,7 +209,7 @@ async def test_sg_analyses_query(self): q = """ query MyQuery($sg_id: String!, $project: String!) { - sequencingGroups(id: {in_: [$sg_id]}) { + sequencingGroups(id: {in_: [$sg_id]}, project: {eq: $project}) { analyses(project: {eq: $project}) { id meta