From 4077084d338e5a01bb420ee57186bf64d37fbd7b Mon Sep 17 00:00:00 2001 From: shrouxm Date: Thu, 8 Jun 2023 15:32:38 -0700 Subject: [PATCH] test: add test --- graphene/relay/tests/test_connection.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/graphene/relay/tests/test_connection.py b/graphene/relay/tests/test_connection.py index d45eea96..9c8b89d1 100644 --- a/graphene/relay/tests/test_connection.py +++ b/graphene/relay/tests/test_connection.py @@ -299,3 +299,20 @@ def test_connectionfield_required(): executed = schema.execute("{ testConnection { edges { cursor } } }") assert not executed.errors assert executed.data == {"testConnection": {"edges": []}} + + +def test_connectionfield_strict_types(): + class MyObjectConnection(Connection): + class Meta: + node = MyObject + strict_types = True + + connection_field = ConnectionField(MyObjectConnection) + edges_field_type = connection_field.type._meta.fields["edges"].type + assert isinstance(edges_field_type, NonNull) + + edges_list_element_type = edges_field_type.of_type.of_type + assert isinstance(edges_list_element_type, NonNull) + + node_field = edges_list_element_type.of_type._meta.fields["node"] + assert isinstance(node_field.type, NonNull)