From 16f2c148cc3c77df95071e099e8fd3f8985d7db6 Mon Sep 17 00:00:00 2001 From: changeling Date: Fri, 7 Jun 2019 15:53:30 -0500 Subject: [PATCH] Created Docs and Example Code Style Guide Work: graphene v 3.0 (markdown) --- ...e-Code-Style-Guide-Work:-graphene-v-3.0.md | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 Docs-and-Example-Code-Style-Guide-Work:-graphene-v-3.0.md diff --git a/Docs-and-Example-Code-Style-Guide-Work:-graphene-v-3.0.md b/Docs-and-Example-Code-Style-Guide-Work:-graphene-v-3.0.md new file mode 100644 index 0000000..818f03c --- /dev/null +++ b/Docs-and-Example-Code-Style-Guide-Work:-graphene-v-3.0.md @@ -0,0 +1,32 @@ +Tracking page for documentation and example code Style Guide discussion. + + +### Elements discussed and decided: + +Use class arguments instead of `class Meta`. + +Example: +Instead of: +``` + class Human(graphene.ObjectType): + class Meta: + interfaces = (Character, ) + + starships = graphene.List(Starship) + home_planet = graphene.String() +``` + +Use: +``` + class Human(graphene.ObjectType, interfaces = (Character, )): + starships = graphene.List(Starship) + home_planet = graphene.String() +``` + +Use f-strings in place of `.format(...)`. + +### Open for discussion: + +Using `root` instead of `self` or `_` in resolver definitions. + +`@staticmethod`? \ No newline at end of file