Fixed so that GrapheneFilterSetMixin is used with any provided filterset_class

This commit is contained in:
sierreis 2019-03-25 23:45:14 -04:00
parent 4d905a46ac
commit 132c4cb9d4

View File

@ -35,17 +35,16 @@ class DjangoFilterConnectionField(DjangoConnectionField):
@property @property
def filterset_class(self): def filterset_class(self):
if not self._filterset_class: if not self._filterset_class:
if not self.node_type._meta.filterset_class: fields = self._fields or self.node_type._meta.filter_fields
fields = self._fields or self.node_type._meta.filter_fields meta = dict(model=self.model, fields=fields)
meta = dict(model=self.model, fields=fields) if self._extra_filter_meta:
if self._extra_filter_meta: meta.update(self._extra_filter_meta)
meta.update(self._extra_filter_meta)
self._filterset_class = get_filterset_class( filterset_class = self._provided_filterset_class or (
self._provided_filterset_class, **meta self.node_type._meta.filterset_class)
) self._filterset_class = get_filterset_class(
else: filterset_class, **meta
self._filterset_class = self.node_type._meta.filterset_class )
return self._filterset_class return self._filterset_class