From 33caa9c10c3a6b853b60cab93a02cbbb7f01c285 Mon Sep 17 00:00:00 2001 From: Naoya Yamashita Date: Sat, 9 Oct 2021 18:28:02 +0900 Subject: [PATCH] docs: add get_human function --- docs/types/objecttypes.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/types/objecttypes.rst b/docs/types/objecttypes.rst index 3cc8d830..f142d4a6 100644 --- a/docs/types/objecttypes.rst +++ b/docs/types/objecttypes.rst @@ -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()