Skip to content

Instantly share code, notes, and snippets.

View ambiflextrous's full-sized avatar

Nelson Xavier ambiflextrous

View GitHub Profile
@jasonphillips
jasonphillips / graphql_tools.py
Last active April 7, 2020 12:38
python graphql-tools imitation
import graphql
# build_executable schema
#
# accepts schema_definition (string) and resolvers (object) in style of graphql-tools
# returns a schema ready for execution
def build_executable_schema(schema_definition, resolvers):
ast = graphql.parse(schema_definition)
schema = graphql.build_ast_schema(ast)