mirror of
https://github.com/graphql-python/graphene-django.git
synced 2025-07-14 02:02:20 +03:00
use connection field
This commit is contained in:
parent
21ec388866
commit
9aed86f668
|
@ -176,8 +176,17 @@ def convert_onetoone_field_to_djangomodel(field, registry=None):
|
||||||
print('TYPE = ', _type)
|
print('TYPE = ', _type)
|
||||||
if not _type:
|
if not _type:
|
||||||
return
|
return
|
||||||
required = define_null_parameter(manager)
|
|
||||||
return Field(_type, source='single', required=required)
|
if _type._meta.connection:
|
||||||
|
# Use a DjangoFilterConnectionField if there are
|
||||||
|
# defined filter_fields in the DjangoObjectType Meta
|
||||||
|
if _type._meta.filter_fields:
|
||||||
|
from .filter.fields import DjangoFilterConnectionField # noqa
|
||||||
|
return DjangoFilterConnectionField(_type)
|
||||||
|
return DjangoConnectionField(_type)
|
||||||
|
return DjangoListField(_type)
|
||||||
|
# required = define_null_parameter(manager)
|
||||||
|
# return Field(_type, source='single', required=required)
|
||||||
|
|
||||||
return Dynamic(dynamic_type)
|
return Dynamic(dynamic_type)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user