mirror of
https://github.com/graphql-python/graphene.git
synced 2025-02-08 23:50:38 +03:00
Added string type upgrade to function
This commit is contained in:
parent
51eb2e593f
commit
2ed800bae3
|
@ -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`
|
* 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
|
## Schema
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user