Improved Upgrade guide

This commit is contained in:
Syrus Akbary 2016-09-14 21:17:43 -07:00
parent 5c6971a608
commit 78ff67eb13

View File

@ -53,6 +53,26 @@ class Query(MyBaseQuery, graphene.ObjectType):
* The `type_name` option in the Meta in types is now `name` * The `type_name` option in the Meta in types is now `name`
## Schema
Schemas in graphene `1.0` are `Immutable`, that means that once you create a `graphene.Schema` any
change in their attributes will not have any effect.
Also the `name` argument is removed from the Schema.
```python
# Old way
schema = graphene.Schema(name='My Schema')
schema.query = Query
schema.mutation = Mutation
# New way
schema = graphene.Schema(
query=Query,
mutation=Mutation
)
```
## Interfaces ## Interfaces
For implementing an Interface in a ObjectType, you have to it onto `Meta.interfaces`. For implementing an Interface in a ObjectType, you have to it onto `Meta.interfaces`.