Skip to content
GraphQL Engine built with Python 3.6+ / asyncio
Branch: master
Clone or download
abusi Merge pull request #171 from dailymotion/ISSUE-160
ISSUE-160. Rename `result(s)` to `errors`
Latest commit e109dd6 Mar 20, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin chore(*): Refactoring of SDL and Tartiflette Apr 3, 2018
docs fix name of query resolvers Mar 18, 2019
libgraphqlparser @ f42c7bc feat(build): Build libgraphqlparser at install time Aug 24, 2018
tartiflette chore(*): Rename result(s) to errors Mar 20, 2019
tests
.coveragerc
.gitignore chore(ci): add Travis as CI and Gazr Specification Sep 14, 2018
.gitmodules
.isort.cfg chore(format): Add format on tests and import sorting everywhere Jan 15, 2019
.travis.yml chore(travis): add pypi test provider to deployment Jan 4, 2019
CHANGELOG.md chore(changelog): Update the changelog Mar 20, 2019
CONTRIBUTORS.md chore(contrib): Update contributors Mar 13, 2019
LICENSE Initial commit Jan 26, 2018
MANIFEST.in fix(manifest): add missing lark file (grammar) Oct 11, 2018
Makefile chore(format): Add format on tests and import sorting everywhere Jan 15, 2019
README.md docs: add documentation for https://tartiflette.io Mar 7, 2019
pylintrc
setup.py chore(release): Release 0.6.7 Mar 18, 2019

README.md

Tartiflette

Tartiflette is a GraphQL Server implementation built with Python 3.6+.

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

Summary

Usage

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())

More details on the API Documentation

Installation

Tartiflette is available on pypi.org.

pip install tartiflette

Installation dependencies

As Tartiflette based its Executor engine on libgraphqlparser. You'll need these following commands on your environment to use the library. cmake, bison and flex.

MacOSX

brew install cmake flex bison

Ubuntu

apt-get install cmake flex bison

Tartiflette over HTTP

Discover our implementation of tartiflette over HTTP called tartiflette-aiohttp.

Overview

pip install tartiflette-aiohttp
from aiohttp import web
from tartiflette_aiohttp import register_graphql_handlers

sdl = """
    type Query {
        hello(name: String): String
    }
"""

ctx = {
    'user_service': user_service
}

web.run_app(
    register_graphql_handlers(
        app=web.Application(),
        engine_sdl=sdl,
        engine_schema_name="default",
        executor_context=ctx,
        executor_http_endpoint='/graphql',
        executor_http_methods=['POST', 'GET']
    )
)

Roadmaps

Known issues

You can’t perform that action at this time.