Skip to main content

FastGraphQL is intended to help developer create code driven GraphQL APIs

Project description

FastGraphQL

FastGraphQL

FastGraphQL is a tool for creating code-driven GraphQL APIs.


pypi Python Versions License

codecov tests

Code Smells Security Rating Maintainability Rating Vulnerabilities Bugs Duplicated Lines (%) Technical Debt


Documentation: https://hugowschneider.github.io/fastgraphql

Source Code: https://github.com/hugowschneider/fastgraphql

Disclaimer

This is still a work in progress and all support is welcomed

Motivation

So far most of the projects that use GraphQL need to duplicate many definitions to be able to have a consistent GraphQL API schema alongside well-defined models that governs the development and the application.

FastGraphQL proposes to shortcut the path between python models and GraphQL schema using Pydantic models. This ensures not only a single source of truth when comes to type, input, query and mutation definitions, but also the ability to use Pydantic to features on models and inputs.

Installation

$ pip install "fastgraphql[all]"

You will also need an ASGI server as well to serve your API

$ pip install "uvicorn[standard]"

Usage

The very first Hello Work example.

from fastapi import FastAPI
from fastgraphql import FastGraphQL
from fastgraphql.fastapi import make_ariadne_fastapi_router

app = FastAPI()
fast_graphql = FastGraphQL()


@fast_graphql.query()
def hello() -> str:
    return "Hello FastGraphQL!!!"


app.include_router(make_ariadne_fastapi_router(fast_graphql=fast_graphql))
$ uvicorn main:app --reload

A simple example will not show you the all FastGraphQL capabilities, but it shows how simple this can be.

Learn

To start your journey into FastGraphQL, please refer to Getting Started.

You can find the API documentation here.

Integration

FastGraphQL generates independently of any integration a data structure containing all GraphQL definitions and resolvers, which generates a GraphQL schema.

With that said, all integration will add functionalities and provide easy and alternative deployments of the defined API.

You can find out more about the different integrations under Integrations

Acknowledgment

Thanks to FastAPI for the inspiration!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fastgraphql-0.0.12.tar.gz (17.8 kB view hashes)

Uploaded Source

Built Distribution

fastgraphql-0.0.12-py3-none-any.whl (20.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page