Skip to content

Commit 74db349

Browse files
conao3erikwrede
andauthored
docs: add get_human function (#1380)
Co-authored-by: Erik Wrede <[email protected]>
1 parent 99f0103 commit 74db349

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

docs/types/objecttypes.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ If we have a schema with Person type and one field on the root query.
8080
8181
from graphene import ObjectType, String, Field
8282
83+
def get_human(name):
84+
first_name, last_name = name.split()
85+
return Person(first_name, last_name)
86+
8387
class Person(ObjectType):
8488
full_name = String()
8589

0 commit comments

Comments
 (0)