Added class arguments example for Python 3

This commit is contained in:
Syrus Akbary 2017-07-11 22:52:38 -07:00
parent 9ce1288e12
commit e86f73d30c

View File

@ -16,6 +16,7 @@
``` ```
With 2.0: With 2.0:
```python ```python
class CommonFields(object): class CommonFields(object):
name = String() name = String()
@ -23,3 +24,21 @@
class Pet(CommonFields, Interface): class Pet(CommonFields, Interface):
pass pass
``` ```
* Meta options as class arguments (**ONLY PYTHON 3**).
Before:
```python
class Dog(ObjectType):
class Meta:
interfaces = [Pet]
name = String()
```
With 2.0:
```python
class Dog(ObjectType, interfaces=[Pet]):
name = String()
```