Skip to content

Instantly share code, notes, and snippets.

@Dviejopomata
Created October 18, 2020 11:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Dviejopomata/9edad79042e32f32568698d5055c3a61 to your computer and use it in GitHub Desktop.
Save Dviejopomata/9edad79042e32f32568698d5055c3a61 to your computer and use it in GitHub Desktop.
Dynamic Schema Graphene
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