Fixed collection count field #247

This commit is contained in:
Sven Heidemann 2023-03-09 11:12:48 +01:00
parent 04fcfddbd9
commit 33279b7053

View File

@ -63,7 +63,7 @@ class QueryABC(ObjectType):
return self._resolve_collection(collection, *args, **kwargs) return self._resolve_collection(collection, *args, **kwargs)
self.set_field(f"{name}s", wrapper) self.set_field(f"{name}s", wrapper)
self.set_field(f"{name}Count", lambda *args: get_collection(*args).count()) self.set_field(f"{name}Count", lambda *args: wrapper(*args).count())
@ServiceProviderABC.inject @ServiceProviderABC.inject
def _can_user_see_element(self, user: AuthUser, element, services: ServiceProviderABC) -> bool: def _can_user_see_element(self, user: AuthUser, element, services: ServiceProviderABC) -> bool: