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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file fastgraphql-0.0.12.tar.gz.

File metadata

  • Download URL: fastgraphql-0.0.12.tar.gz
  • Upload date:
  • Size: 17.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for fastgraphql-0.0.12.tar.gz
Algorithm Hash digest
SHA256 77dec2530617bd060045c25224946de914465a5fe803449fe478f7f9cfbbe7c1
MD5 cdb9f85834ee73485421e0aefafe333f
BLAKE2b-256 82e53300736ce3d3c79a204c012bddcd2aa1a5af0529fc46461013aab5cd2cb6

See more details on using hashes here.

File details

Details for the file fastgraphql-0.0.12-py3-none-any.whl.

File metadata

  • Download URL: fastgraphql-0.0.12-py3-none-any.whl
  • Upload date:
  • Size: 20.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for fastgraphql-0.0.12-py3-none-any.whl
Algorithm Hash digest
SHA256 0af66e0023fc13b089b64f2c3d20e7555700dc844e22865b2fd44111d89930d6
MD5 a5a30ee1e72c0038362b628cef15fe95
BLAKE2b-256 c8b74150e7717306071fccfaba764e27b65dbbc20c90f3208eb1a2764eb8c7a6

See more details on using hashes here.

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