instruct-br / graphene-django-pagination

MIT License
27 stars 13 forks source link

fix(pagination): fix resolve_connection in django 3.x versions #7

Closed richardnfag closed 3 years ago

richardnfag commented 3 years ago

In Django 3.x versions they have the following error:

resolve_connection() got an unexpected keyword argument 'max_limit'

That's because in 3.x versions they use the resolve_connection method with these arguments:

def resolve_connection(cls, connection, args, iterable, max_limit=None):

However, in versions 2.x they use these other arguments:

def resolve_connection(cls, connection, default_manager, args, iterable):

These changes to the resolve_connection method fix this bug in 3.x versions and maintain backward compatibility with 2.x versions.

I tested it with the following version combinations:

django = "==2.2.6"
django-filter = "==2.1.0"
graphene-django = "==2.6.0"
django = "==3.2.5"
django-filter = "==2.4.0"
graphene-django = "==2.15.0"