From 6ceb07c51c1646c224966f9a3086d143aa0b5aa0 Mon Sep 17 00:00:00 2001 From: Syrus Akbary Date: Wed, 26 Jul 2017 23:36:08 -0700 Subject: [PATCH] Improved resolver consistency --- graphene_django/fields.py | 5 +++-- graphene_django/filter/fields.py | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/graphene_django/fields.py b/graphene_django/fields.py index a85d5d8..c6cde9a 100644 --- a/graphene_django/fields.py +++ b/graphene_django/fields.py @@ -4,6 +4,7 @@ from django.db.models.query import QuerySet from promise import Promise +from graphene import final_resolver from graphene.types import Field, List from graphene.relay import ConnectionField, PageInfo from graphql_relay.connection.arrayconnection import connection_from_list_slice @@ -128,11 +129,11 @@ class DjangoConnectionField(ConnectionField): return on_resolve(iterable) def get_resolver(self, parent_resolver): - return partial( + return final_resolver(partial( self.connection_resolver, parent_resolver, self.type, self.get_manager(), self.max_limit, self.enforce_first_or_last - ) + )) diff --git a/graphene_django/filter/fields.py b/graphene_django/filter/fields.py index fc414bf..c98e10a 100644 --- a/graphene_django/filter/fields.py +++ b/graphene_django/filter/fields.py @@ -1,7 +1,7 @@ from collections import OrderedDict from functools import partial -# from graphene.relay import is_node +from graphene import final_resolver from graphene.types.argument import to_arguments from ..fields import DjangoConnectionField from .utils import get_filtering_args_from_filterset, get_filterset_class @@ -89,7 +89,7 @@ class DjangoFilterConnectionField(DjangoConnectionField): ) def get_resolver(self, parent_resolver): - return partial( + return final_resolver(partial( self.connection_resolver, parent_resolver, self.type, @@ -98,4 +98,4 @@ class DjangoFilterConnectionField(DjangoConnectionField): self.enforce_first_or_last, self.filterset_class, self.filtering_args - ) + ))