Files
zenml/venv/lib/python3.9/site-packages/graphene/tests/issues/test_356.py
Christian Mantha 2ca0b9ef7c star
2026-03-02 19:10:52 -05:00

34 lines
698 B
Python

# https://github.com/graphql-python/graphene/issues/356
from pytest import raises
import graphene
from graphene import relay
class SomeTypeOne(graphene.ObjectType):
pass
class SomeTypeTwo(graphene.ObjectType):
pass
class MyUnion(graphene.Union):
class Meta:
types = (SomeTypeOne, SomeTypeTwo)
def test_issue():
class Query(graphene.ObjectType):
things = relay.ConnectionField(MyUnion)
with raises(Exception) as exc_info:
graphene.Schema(query=Query)
assert str(exc_info.value) == (
"Query fields cannot be resolved."
" IterableConnectionField type has to be a subclass of Connection."
' Received "MyUnion".'
)