graphene-django/graphene_django/countable.py
2019-03-23 04:04:31 +03:00

12 lines
275 B
Python

from graphene.relay import Connection
from graphene.types.scalars import Int
class CountableConnectionInitial(Connection):
class Meta:
abstract = True
total_count = Int()
def resolve_total_count(self, info, **kwargs):
return len(self.iterable)