Skip to content

Commit 9a3d843

Browse files
authored
Merge pull request #342 from ekampf/feature/connection_edges_should_be_nonnull
Connection Edges should be NonNull
2 parents c7a48c3 + 344d85c commit 9a3d843

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

examples/starwars_relay/tests/test_objectidentification.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def test_str_schema():
5656
5757
type ShipConnection {
5858
pageInfo: PageInfo!
59-
edges: [ShipEdge]
59+
edges: [ShipEdge]!
6060
}
6161
6262
type ShipEdge {

graphene/relay/connection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class EdgeBase(AbstractType):
8282

8383
class ConnectionBase(AbstractType):
8484
page_info = Field(PageInfo, name='pageInfo', required=True)
85-
edges = List(edge)
85+
edges = NonNull(List(edge))
8686

8787
bases = (ConnectionBase, ) + bases
8888
attrs = dict(attrs, _meta=options, Edge=edge)

graphene/relay/tests/test_connection.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@ class Edge:
2828
pageinfo_field = fields['page_info']
2929

3030
assert isinstance(edge_field, Field)
31-
assert isinstance(edge_field.type, List)
32-
assert edge_field.type.of_type == MyObjectConnection.Edge
31+
assert isinstance(edge_field.type, NonNull)
32+
assert isinstance(edge_field.type.of_type, List)
33+
assert edge_field.type.of_type.of_type == MyObjectConnection.Edge
3334

3435
assert isinstance(pageinfo_field, Field)
3536
assert isinstance(pageinfo_field.type, NonNull)

0 commit comments

Comments
 (0)