We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 6c7cb40 + f3f210b commit 4677677Copy full SHA for 4677677
examples/field_example.py
@@ -0,0 +1,27 @@
1
+import graphene
2
+
3
4
+class Patron(graphene.ObjectType):
5
+ id = graphene.ID()
6
+ name = graphene.String()
7
+ age = graphene.ID()
8
9
10
+class Query(graphene.ObjectType):
11
12
+ patron = graphene.Field(Patron)
13
14
+ def resolve_patron(self, args, info):
15
+ return Patron(id=1, name='Demo')
16
17
+schema = graphene.Schema(query=Query)
18
+query = '''
19
+ query something{
20
+ patron {
21
+ id
22
+ name
23
+ }
24
+}
25
+'''
26
+result = schema.execute(query)
27
+print(result.data['patron'])
0 commit comments