From 2ed800bae3d6dab65a320a0f1d73edde6994c9ab Mon Sep 17 00:00:00 2001 From: Syrus Akbary Date: Sun, 18 Sep 2016 13:14:52 -0700 Subject: [PATCH] Added string type upgrade to function --- UPGRADE-v1.0.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/UPGRADE-v1.0.md b/UPGRADE-v1.0.md index c54f4acc..0ed058a7 100644 --- a/UPGRADE-v1.0.md +++ b/UPGRADE-v1.0.md @@ -52,6 +52,24 @@ We have done our best to provide backwards compatibility with deprecated APIs. * The `type_name` option in the Meta in types is now `name` +* Type references no longer work with strings, but with functions. + + Before: + + ```python + class Query(graphene.ObjectType): + user = graphene.Field('User') + users = graphene.List('User') + ``` + + With 1.0: + + ```python + class Query(graphene.ObjectType): + user = graphene.Field(lambda: User) + users = graphene.List(lambda: User) + ``` + ## Schema