mirror of
https://github.com/graphql-python/graphene.git
synced 2025-02-08 23:50:38 +03:00
Improved test coverage
This commit is contained in:
parent
66468e3ea5
commit
40a15bdd21
|
@ -9,6 +9,8 @@ from ..types import (Boolean, Enum, Int, Interface, List, NonNull, Scalar,
|
|||
String, Union)
|
||||
from ..types.field import Field
|
||||
from ..types.objecttype import ObjectType, ObjectTypeOptions
|
||||
from ..utils.deprecated import warn_deprecation
|
||||
from .node import is_node
|
||||
|
||||
|
||||
class PageInfo(ObjectType):
|
||||
|
@ -98,6 +100,12 @@ class IterableConnectionField(Field):
|
|||
def type(self):
|
||||
type = super(IterableConnectionField, self).type
|
||||
connection_type = type
|
||||
if is_node(type):
|
||||
warn_deprecation(
|
||||
"ConnectionField's now need a explicit ConnectionType for Nodes.\n"
|
||||
"Read more: https://github.com/graphql-python/graphene/blob/2.0/UPGRADE-v2.0.md#node-connections"
|
||||
)
|
||||
|
||||
assert issubclass(connection_type, Connection), (
|
||||
'{} type have to be a subclass of Connection. Received "{}".'
|
||||
).format(self.__class__.__name__, connection_type)
|
||||
|
|
Loading…
Reference in New Issue
Block a user