diff --git a/server/api/routes/search.py b/server/api/routes/search.py
index 0c0f2f935bac96495417589cbd0c5bcda1e3f179..5e1e6c9134effd174f93d5dfdc6f7c6e3014594d 100644
--- a/server/api/routes/search.py
+++ b/server/api/routes/search.py
@@ -112,7 +112,7 @@ async def nql_query(query: NQLFilter,
 
 @router.post('/nql/count', response_model=int)
 async def nql_query_count(query: NQLFilter,
-                          permissions: UserPermissions = Depends(UserPermissionChecker('dataset_read'))) -> QueryResult:
+                          permissions: UserPermissions = Depends(UserPermissionChecker('dataset_read'))) -> int:
     async with db_engine.session() as session:  # type: AsyncSession
         nql = await _get_query(session=session, query=query, project_id=permissions.permissions.project_id)
-        return (await session.execute(func.count(nql.stmt.subquery().c.item_id))).scalar()
+        return (await session.execute(func.count(nql.stmt.subquery().c.item_id))).scalar()  # type: ignore[return-value]