mirror of
https://github.com/graphql-python/graphene.git
synced 2026-02-14 11:10:34 +03:00
31 lines
641 B
Python
31 lines
641 B
Python
# https://github.com/graphql-python/graphene/issues/356
|
|
|
|
import pytest
|
|
|
|
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():
|
|
with pytest.raises(Exception) as exc_info:
|
|
class Query(graphene.ObjectType):
|
|
things = relay.ConnectionField(MyUnion)
|
|
|
|
schema = graphene.Schema(query=Query)
|
|
|
|
assert str(exc_info.value) == 'IterableConnectionField type have to be a subclass of Connection. Received "MyUnion".'
|