mirror of
https://github.com/graphql-python/graphene.git
synced 2024-11-10 19:56:45 +03:00
Modify the field example to remove the use of interface
This commit is contained in:
parent
295fba37d1
commit
f3f210b523
|
@ -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'])
|
||||
|
|
Loading…
Reference in New Issue
Block a user