GraphQL Engine built with Python 3.6+ / asyncio
Tartiflette is a GraphQL Server implementation built with Python 3.7+.
Summary
Read this blogpost about our motivations TL; DR We reached the limits of Graphene, we wanted to build something which met certain requirements:
The first milestone is behind us, we are now on the road to the milestone 2.
DNA
Discover Tartiflette with our fabulous tutorial on https://tartiflette.io/docs/tutorial/getting-started
import asyncio
from tartiflette import Resolver, create_engine
@Resolver("Query.hello")
async def resolver_hello(parent, args, ctx, info):
return "hello " + args["name"]
async def run():
engine = await create_engine(
"""
type Query {
hello(name: String): String
}
"""
)
result = await engine.execute(
query='query { hello(name: "Chuck") }'
)
print(result)
# {'data': {'hello': 'hello Chuck'}}
if __name__ == "__main__":
asyncio.run(run())
More details on the API Documentation
Tartiflette is available on pypi.org.
While the project depends on libgraphqlparser, wheels are provided since version 1.4.0, ensuring that no system dependency is required.
To install the library:
pip install tartiflette
If you use a platform incompatible with the provided wheels, you'll need to install cmake
to build libgraphqlparser
in order to install the library.
macOS
brew install cmake
Debian/Ubuntu
apt-get install cmake
tartiflette
library itself is transport agnostic, but to simplify integration with existing HTTP servers, two
different libraries are available:
aiohttp
As you may know, the documentation is hosted on https://tartiflette.io. This fabulous website is built thanks to another amazing tool, docusaurus.
The content of the documentation is hosted in this repository, to be as close as possible to the code. You will find everything you need/want in the folder /docs
.
We built a docker image for the documentation (tartiflette/tartiflette.io on docker hub), which allow us to provide you an easy way to launch the documentation locally, without installing a specific version of node.
prerequisite:
make run-docs
Every change you will make in the /docs
folder will be automatically hot reloaded. :tada: