docs: add get_human function

This commit is contained in:
Naoya Yamashita 2021-10-09 18:28:02 +09:00
parent 0a54094f59
commit 33caa9c10c
No known key found for this signature in database
GPG Key ID: F4B6A5A98EB01936

View File

@ -80,6 +80,10 @@ If we have a schema with Person type and one field on the root query.
from graphene import ObjectType, String, Field
def get_human(name):
first_name, last_name = name.split()
return Person(first_name, last_name)
class Person(ObjectType):
full_name = String()