Created
October 18, 2020 11:16
-
-
Save Dviejopomata/9edad79042e32f32568698d5055c3a61 to your computer and use it in GitHub Desktop.
Dynamic Schema Graphene
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def resolve_hello(self, info, name): | |
return "Hello " + name + " " + str(uuid.uuid4()) | |
Query = type('Query', (graphene.ObjectType,), { | |
'hello': graphene.String(name=graphene.String(default_value="stranger")), | |
'resolve_hello': resolve_hello, | |
}) | |
schema = build_schema(query=Query) | |
graphql_handler = GraphQLApp(schema=schema) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment