mirror of
https://github.com/graphql-python/graphene.git
synced 2024-11-11 04:07:16 +03:00
Merge pull request #342 from ekampf/feature/connection_edges_should_be_nonnull
Connection Edges should be NonNull
This commit is contained in:
commit
9a3d84319d
|
@ -56,7 +56,7 @@ type Ship implements Node {
|
||||||
|
|
||||||
type ShipConnection {
|
type ShipConnection {
|
||||||
pageInfo: PageInfo!
|
pageInfo: PageInfo!
|
||||||
edges: [ShipEdge]
|
edges: [ShipEdge]!
|
||||||
}
|
}
|
||||||
|
|
||||||
type ShipEdge {
|
type ShipEdge {
|
||||||
|
|
|
@ -82,7 +82,7 @@ class ConnectionMeta(ObjectTypeMeta):
|
||||||
|
|
||||||
class ConnectionBase(AbstractType):
|
class ConnectionBase(AbstractType):
|
||||||
page_info = Field(PageInfo, name='pageInfo', required=True)
|
page_info = Field(PageInfo, name='pageInfo', required=True)
|
||||||
edges = List(edge)
|
edges = NonNull(List(edge))
|
||||||
|
|
||||||
bases = (ConnectionBase, ) + bases
|
bases = (ConnectionBase, ) + bases
|
||||||
attrs = dict(attrs, _meta=options, Edge=edge)
|
attrs = dict(attrs, _meta=options, Edge=edge)
|
||||||
|
|
|
@ -28,8 +28,9 @@ def test_connection():
|
||||||
pageinfo_field = fields['page_info']
|
pageinfo_field = fields['page_info']
|
||||||
|
|
||||||
assert isinstance(edge_field, Field)
|
assert isinstance(edge_field, Field)
|
||||||
assert isinstance(edge_field.type, List)
|
assert isinstance(edge_field.type, NonNull)
|
||||||
assert edge_field.type.of_type == MyObjectConnection.Edge
|
assert isinstance(edge_field.type.of_type, List)
|
||||||
|
assert edge_field.type.of_type.of_type == MyObjectConnection.Edge
|
||||||
|
|
||||||
assert isinstance(pageinfo_field, Field)
|
assert isinstance(pageinfo_field, Field)
|
||||||
assert isinstance(pageinfo_field.type, NonNull)
|
assert isinstance(pageinfo_field.type, NonNull)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user