mirror of
https://github.com/graphql-python/graphene.git
synced 2025-02-02 12:44:15 +03:00
Improved Upgrade guide
This commit is contained in:
parent
5c6971a608
commit
78ff67eb13
|
@ -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`.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user