diff --git a/site/code/index.html.js b/site/code/index.html.js index 69b2f31fb5..e81b25196f 100644 --- a/site/code/index.html.js +++ b/site/code/index.html.js @@ -380,6 +380,49 @@ print(result.data['hello']) # "Hello World" There are also nice bindings for [Relay](https://facebook.github.io/relay/), Django, SQLAlchemy, and Google App Engine. +#### [Tartiflette](https://tartiflette.io) ([github](https://github.com/dailymotion/tartiflette)) + +A Python 3.6+ _(asyncio)_ library for building GraphQL APIs. + +To run a tartiflette hello world script: + +\`\`\`bash +pip install tartiflette +\`\`\` + +Then run \`python hello.py\` with this code in \`hello.py\`: + +\`\`\`python +import asyncio + +from tartiflette import Engine, Resolver + +@Resolver("Query.hello") +async def resolver_hello(parent, args, ctx, info): + return "hello " + args["name"] + + +async def run(): + tftt_engine = Engine(""" + type Query { + hello(name: String): String + } + """) + + result = await tftt_engine.execute( + query='query { hello(name: "Chuck") }' + ) + + print(result) + # {'data': {'hello': 'hello Chuck'}} + +if __name__ == "__main__": + loop = asyncio.get_event_loop() + loop.run_until_complete(run()) +\`\`\` + +There is also a nice [HTTP wrapper](https://github.com/dailymotion/tartiflette-aiohttp). + ### Ruby #### [graphql-ruby](https://github.com/rmosolgo/graphql-ruby)