Skip to content

Commit 0bfe158

Browse files
author
Alexandre Kirszenberg
committed
Set converted Django connections to required
1 parent b1a9293 commit 0bfe158

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

graphene_django/converter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,9 @@ def dynamic_type():
195195
if _type._meta.filter_fields or _type._meta.filterset_class:
196196
from .filter.fields import DjangoFilterConnectionField
197197

198-
return DjangoFilterConnectionField(_type, description=description)
198+
return DjangoFilterConnectionField(_type, required=True, description=description)
199199

200-
return DjangoConnectionField(_type, description=description)
200+
return DjangoConnectionField(_type, required=True, description=description)
201201

202202
return DjangoListField(
203203
_type,

graphene_django/filter/fields.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def get_resolver(self, parent_resolver):
111111
return partial(
112112
self.connection_resolver,
113113
parent_resolver,
114-
self.type,
114+
self.connection_type,
115115
self.get_manager(),
116116
self.max_limit,
117117
self.enforce_first_or_last,

graphene_django/tests/test_converter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ class Meta:
255255
assert isinstance(graphene_field, graphene.Dynamic)
256256
dynamic_field = graphene_field.get_type()
257257
assert isinstance(dynamic_field, ConnectionField)
258-
assert dynamic_field.type == A._meta.connection
258+
assert dynamic_field.type.of_type == A._meta.connection
259259

260260

261261
def test_should_manytoone_convert_connectionorlist():

graphene_django/tests/test_types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ def test_schema_representation():
173173
pets: [Reporter!]!
174174
aChoice: ReporterAChoice
175175
reporterType: ReporterReporterType
176-
articles(before: String, after: String, first: Int, last: Int): ArticleConnection
176+
articles(before: String, after: String, first: Int, last: Int): ArticleConnection!
177177
}
178178
179179
enum ReporterAChoice {

0 commit comments

Comments
 (0)