• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

tartiflette/tartiflette: GraphQL Engine built with Python 3.6+ / asyncio

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

tartiflette/tartiflette

开源软件地址(OpenSource Url):

https://github.com/tartiflette/tartiflette

开源编程语言(OpenSource Language):

Python 100.0%

开源软件介绍(OpenSource Introduction):

Tartiflette

Quality Gate Status Total alerts Language grade: Python

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

Summary

Motivation

Read this blogpost about our motivations TL; DR We reached the limits of Graphene, we wanted to build something which met certain requirements:

  • Offers a better developer experience that respects the Python mindset
  • Uses SDL (Schema Definition Language)
  • Uses asyncio as the sole execution engine
  • Be 100% open source

Status

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

Usage

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

Installation

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

Building from source

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

HTTP server implementations

tartiflette library itself is transport agnostic, but to simplify integration with existing HTTP servers, two different libraries are available:

Roadmaps

How to contribute to the documentation?

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.

How to run the website locally?

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:

  • Docker
  • Docker Compose
  • Make
make run-docs

Every change you will make in the /docs folder will be automatically hot reloaded.


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
directus/directus: The Modern Data Stack 发布时间:2022-06-22
下一篇:
entria/graphql-mongoose-loader: GraphQL Mongoose Loader helpers发布时间:2022-06-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap