From 74db349da4fb72268b309b674361ffbd9e8885e0 Mon Sep 17 00:00:00 2001 From: Naoya Yamashita Date: Wed, 19 Jul 2023 16:01:00 +0900 Subject: [PATCH] docs: add get_human function (#1380) Co-authored-by: Erik Wrede --- 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()