Skip to content

Add 'tartiflette' library for Python #673

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions site/code/index.html.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down