Modify the field example to remove the use of interface

This commit is contained in:
Amit Saha 2015-11-20 16:25:18 +11:00
parent 295fba37d1
commit f3f210b523

View File

@ -1,15 +1,12 @@
import graphene
class Person(graphene.Interface):
class Patron(graphene.ObjectType):
id = graphene.ID()
name = graphene.String()
age = graphene.ID()
class Patron(Person):
id = graphene.ID()
class Query(graphene.ObjectType):
patron = graphene.Field(Patron)
@ -27,5 +24,4 @@ query = '''
}
'''
result = schema.execute(query)
# Print the result
print(result.data['patron'])