Skip to content

Commit f3f210b

Browse files
committed
Modify the field example to remove the use of interface
1 parent 295fba3 commit f3f210b

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

examples/field_example.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
import graphene
22

33

4-
class Person(graphene.Interface):
4+
class Patron(graphene.ObjectType):
5+
id = graphene.ID()
56
name = graphene.String()
67
age = graphene.ID()
78

89

9-
class Patron(Person):
10-
id = graphene.ID()
11-
12-
1310
class Query(graphene.ObjectType):
1411

1512
patron = graphene.Field(Patron)
@@ -27,5 +24,4 @@ def resolve_patron(self, args, info):
2724
}
2825
'''
2926
result = schema.execute(query)
30-
# Print the result
3127
print(result.data['patron'])

0 commit comments

Comments
 (0)